nuxtignore-dev
v1.0.0
Published
Nuxt module for support of .nuxtignore.dev file
Downloads
614
Readme
Nuxtignore Dev
Nuxt module which replaces the behavior of .nuxtignore
, but for development purpose only, using .nuxtignore.dev
, analogous to .env.dev
. If a project is too large and containes big number of pages, such functionality
can help to pick out only specific pages in the development mode, thereby making builds faster.
The current module supports both 2 and 3 versions of Nuxt.
Setup
npm i -D nuxtignore-dev # npm
yarn add -D nuxtignore-dev # yarn
pnpm add -D nuxtignore-dev # pnpm
Usage
- Creating file
.nuxtignore.dev
, similar to the existing file.nuxtignore.dev
pages/index.vue
middleware/*
It can also be useful to add .nuxtignore.dev
to .gitignore
.
- Register the module in the
modules
array innuxt.config.ts
:
// nuxt.config.js
{
modules: [
"nuxtignore-dev",
],
nuxtignoreDev: { // optional
enabled: process.env.NODE_ENV === 'development',
// custom path to a file or filename
filePath: '/etc/.custom-nuxtignore'
// if set to true and the file is not found, error is thrown
strict: false,
// if set to true, ignored patterns are applied to pages added by hook "pages:extend"
isPagesExtendHookIncluded: true,
}
}