speculation rule Api nuxt module
npm install nuxt-speculation-rule[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]
My new Nuxt module for doing amazing things.
- 🌲 Implement page preloading according to Speculation Rules API
1. Add nuxt-speculation-rule dependency to your project
``bashUsing pnpm
pnpm add -D nuxt-speculation-rule
2. Add
nuxt-speculation-rule to the nuxt-speculation-rule section of nuxt.config.ts`js
export default defineNuxtConfig({
modules: [
'nuxt-speculation-rule'
]
})
`That's it! You can now use nuxt-speculation-rule in your Nuxt app ✨
Config
`ts
export default defineNuxtConfig({
modules: [
'nuxt-speculation-rule'
],
speculationRules: {
prerender: [
{
source: "list",
urls: ["/test1", "/test2"],
},
],
},
})
`Development
`bash
Install dependencies
npm installGenerate type stubs
npm run dev:prepareDevelop with the playground
npm run devBuild the playground
npm run dev:buildRun ESLint
npm run lintRun Vitest
npm run test
npm run test:watchRelease new version
npm run release
``
[npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/my-module
[npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/my-module
[license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/my-module
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com