Ignore specific file type in directory and all sub-directories?
See original GitHub issueI have been trying to ignore a specific file type in a directory and all its subdirectories, however nodemon keeps reloading regardless.
Expected behaviour
For example, I am trying to ignore all js files in the views directory as well as any subdirectories. I am currently using a nodemon.json file with the following config object:
{ "verbose": true, "ignore": ["views/*.js", "views/**/*.js"], "ext": "js, ejs, json" }
Actual behaviour
Nodemon still reloads on saving any js file in any subdirectory of the “views” folder.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
gitignore all files of extension in directory - Stack Overflow
This will ignore all .js files in your git repository. To exclude certain type of file from a particular directory, you can add...
Read more >.gitignore File – How to Ignore Files and Folders in Git
Inside .gitignore , you can tell Git to ignore only a single file or a single folder by mentioning the name or pattern...
Read more >Git Tutorial => Ignoring files and directories with a .gitignore file
You can make Git ignore certain files and directories — that is, exclude them from being tracked by Git — by creating one...
Read more >.gitignore file - ignoring files in Git | Atlassian Git Tutorial
Git ignore patterns are used to exclude certain files in your working directory from your Git history. They can be local, global, or...
Read more >Ignoring Files and Directories in Git (.gitignore) - Linuxize
A local .gitignore file is usually placed in the repository's root directory. However, you can create multiple .gitignore files in different ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Turns out I had forgotten the last change I made to the config file. The original glob pattern does not work, however the following does:
{ "verbose": true, "ext": "js, ejs, json", "ignore": ["views\\**\\*.js"] }
I am not sure why, but it may have something to do with the backslashes in the file paths matching the pattern check.I restarted and it seems to be working now. Seems I misunderstood the console logs, nodemon was not actually restarting, just running a file check to check if reload needs to be done. Apologies for the confusion.