Reputation: 2043
I have a problem with nuxt ignore to exclude some folders from being watched especially during development. I have searched the internet and the solutions don't seem to work for me.
My .nuxtignore
file
.idea/
And the ignore property in nuxt.config.js
ignore: [
'**/*.test.*',
'node_modules/*',
'**/.idea/*',
'**/.nuxt/*',
'**/.*ignore',
],
I have also tried using the options independently, initially tried .idea/*
in both files, still doesn't work, I get output like this in console:
↻ Updated .idea/workspace.xml 16:36:04
✔ Client
Compiled successfully in 7.20s
No issues found.
Is there anything am missing here?
Upvotes: 3
Views: 3688
Reputation: 36
Note: my response below is for Nuxt3/vite so not specific to the original question, but sharing anyway as this was one of the results that came up in my search for trying to resolve the problem I had
None of the other answers here worked for me. What finally did was adding an ignore
array as per the docs to the nuxt.config.ts file. I was getting typescript errors when using some of the other solutions here.
For reference currently running
Nuxi 3.0.0-rc.12
Nuxt 3.0.0-rc.12 with Nitro 0.6.1
// nuxt.config.ts:
...
ignore: [
"path/to/ignore/**"
],
...
Upvotes: 0
Reputation: 46696
This kind of configuration makes that the pages
directory is not watched.
nuxt.config.js
export default {
watchers: {
webpack: {
ignored: /(pages)/,
},
},
}
As mentioned here: https://github.com/nuxt/nuxt.js/issues/6326#issuecomment-1009037909
Upvotes: 3