Nuxt module to create new _headers and _redirects files for Netlify or to use existing ones
Nuxt module to create new _headers and _redirects files for Netlify or to use existing ones
@nuxtjs/netlify-files dependency to your projectyarn add @nuxtjs/netlify-files # or npm install @nuxtjs/netlify-files
@nuxtjs/netlify-files to the modules section of nuxt.config.js{
modules: [
// Simple usage
'@nuxtjs/netlify-files',
// With options
['@nuxtjs/netlify-files', { /* module options */ }]
]
}
Currently, the module will look for _headers and _redirects files and will copy into the generate folder
(default: dist) after static generation. If you have them directly in your project folder, you donโt have to do
anything else. In case the files are somewhere else you can configure the directory (see below)
export default {
netlifyFiles: {
existingFilesDirectory: 'path/to/nuxt/directory', // The directory where your _headers and _redirects file is located
}
}
yarn install or npm installnpm run devCopyright ยฉ Alexander Lichter npm@lichter.io
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.