How to exclude directories / files from the Meteor package

Meteor keeps track of the current project directory to modify the file so that it can automatically restart the server.

As my project grew, I noticed that the time it took for each β€œupdate” increased from ~ 1 second to 8 seconds.

I want to exclude some files and directories, and I am wondering if I need to edit app / lib / bundler.js or if there is a better way.

Thanks.

+7
javascript meteor
source share
2 answers

The package ( tools/bundler.js ) has a list of regular expressions that it ignores:

 // files to ignore when bundling. node has no globs, so use regexps var ignore_files = [ /~$/, /^\.#/, /^#.*#$/, /^\.DS_Store$/, /^ehthumbs\.db$/, /^Icon.$/, /^Thumbs\.db$/, /^\.meteor$/, /* avoids scanning N^2 files when bundling all packages */ /^\.git$/ /* often has too many files to watch */ ]; 

Another approach is to place the files in the test directory. If you do not request a bundle of tests, this is out of the question.

One recent approach is to place files in the packages directory. I don’t think you even need a package.js stub file.

Both of these parameters are a bit hacked, but are great for maintenance.

I think it would be nice if there was something like .meteorignore akin to .gitignore .

+10
source share

Another way is to prefix the folders that you want to exclude with a period.

+12
source share

All Articles