Meteor watches the current project's directory for file changes so that it can automatically restart the server.
As my project grew in size, I noticed that the time it takes for each "refresh" has gone up from ~1 seconds to 8+ seconds.
I'm looking to exclude some files and directories, and I'm wondering if I should edit app/lib/bundler.js or if there's a better way.
Thanks.
Another way is to prefix folders you want to exclude with a period.
The bundler (tools/bundler.js
) has a list of regexps 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 a test
directory. Unless you request to bundle tests, this is excluded.
One final approach is is to put files under the packages
directory. I don't think you even need to have a stub package.js
file.
Both of these options are a little bit hacky, but perfectly serviceable.
I think it would be nice if there was something like .meteorignore
akin to .gitignore
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With