Closed lkmill closed 7 years ago
I think the best way to approach this would be to specify watch
options in the main config object, two of which could be include
and exclude
(same as with plugins):
// rollup.config.js
export default {
entry: 'src/index.js',
dest: 'bundle.js',
format: 'iife',
watch: {
exclude: 'node_modules/**'
}
};
A lot of times I do want to watch my node_modules
, because I'm often using npm link
. Since not rebuilding when npm dependencies change would be unexpected behaviour, I don't think it should be the default, but I get why it would be useful as an option.
That sounds fair enough, and definitely solves my problems!
This is also needed when for example pre-compiling (e.g typescript etc) to js is required
Released 4.2.0 with this. Details on the PR: https://github.com/rollup/rollup-watch/pull/56
It feels silly to be watching all files imported from node_modules as they are unlikely to change in normal environments. Would it not be reasonable to skip those by default, and instead allow passing an option to watch them?