Nuxt module to create new _headers and _redirects files for Netlify or to use existing ones
- Add
@nuxtjs/netlify-filesdependency to your project
yarn add @nuxtjs/netlify-files # or npm install @nuxtjs/netlify-files- Add
@nuxtjs/netlify-filesto themodulessection ofnuxt.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
}
}- Clone this repository
- Install dependencies using
yarn installornpm install - Start development server using
npm run dev
Copyright (c) Alexander Lichter npm@lichter.io