nuxt-speculation-rule
v0.1.1
Published
speculation rule Api nuxt module
Downloads
45
Readme
My Module
My new Nuxt module for doing amazing things.
Features
- 🌲 Implement page preloading according to Speculation Rules API
Quick Setup
- Add
nuxt-speculation-rule
dependency to your project
# Using pnpm
pnpm add -D nuxt-speculation-rule
# Using yarn
yarn add --dev nuxt-speculation-rule
# Using npm
npm install --save-dev nuxt-speculation-rule
- Add
nuxt-speculation-rule
to thenuxt-speculation-rule
section ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
'nuxt-speculation-rule'
]
})
That's it! You can now use nuxt-speculation-rule in your Nuxt app ✨
Config
export default defineNuxtConfig({
modules: [
'nuxt-speculation-rule'
],
speculationRules: {
prerender: [
{
source: "list",
urls: ["/test1", "/test2"],
},
],
},
})
Development
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release