0.0.1 • Published 2 years ago
nuxt-revalidate v0.0.1
Nuxt Revalidate
🧹 Nuxt revalidate module
Quick Setup
- Add
nuxt-revalidatedependency to your project
# Using pnpm
pnpm add -D nuxt-revalidate
# Using yarn
yarn add --dev nuxt-revalidate
# Using npm
npm install --save-dev nuxt-revalidate- Add
nuxt-revalidateto themodulessection ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
'nuxt-revalidate'
]
})- Protect
/__revalidate__endpoint using secret key in.envornuxt.config.ts
REVALIDATE_KEY=YOUR_SECRET_KEYexport default defineNuxtConfig({
revalidate: {
key: 'YOUR_SECRET_KEY'
}
});That's it! You can now call /__revalidate__?path=ROUTE_TO_REVALIDATE&key=YOUR_SECRET_KEY and clear cached route.
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 release0.0.1
2 years ago