I can't figure out what configuration to use here, to ignore the node_modules folder. Currently if I install a new package the browser-sync reacts to hundreds of new files.
I'm proxying HarpJS with the following file; harp serves from the /public directory.
API documentation mentions two patterns for ignoring files but I've tried both with no success.
.
|-- node_modules
|-- private
`-- public
And my file looks like this
var bs = require('browser-sync').create();
bs.init({
notify: false,
proxy: "localhost:9000",
browser: ["google chrome canary"],
watchOptions: {
ignoreInitial: true,
ignored: ['./node_modules']
},
files: [
'./public/**/*.js',
'./public/**/*.jade',
'./public/**/*.md',
'./**/*.json',
{
match: './public/**/*.scss',
fn: function (event, file) {
if (event === 'change') {
bs.reload(['local.css', '/assets/stylesheets/app.css']);
}
}
}
]
});
Change your watchOptions to
watchOptions: {
ignoreInitial: true,
ignored: ['node_modules']
},
tested this locally and it works as you expect :)
Thanks @shakyShane !
Most helpful comment
Change your watchOptions to
tested this locally and it works as you expect :)