You do:
legacyWatch: true
All options with a dash are referred to with camelcase when being required.
题
I tried to set nodemon -L (--legacy-watch) option as a nodemon config for gulp-nodemon as adding it with null string value in the following but it did not work. Can anyone help?
gulp.task('server', function () {
nodemon({
script: 'server.js',
watch: paths.server,
env: { 'NODE_ENV': 'development' },
'legacy-watch': ''
}).on('restart', 'lint');
});
解决方案
You do:
legacyWatch: true
All options with a dash are referred to with camelcase when being required.
其他提示
Actually this is documented on nodemon's github page:
https://github.com/remy/nodemon/blob/master/doc/sample-nodemon.md
You would do something like this...
nodemon({
script: "server.js",
execMap: {
js: "node --harmony"
}
}).on("restart", function() {
console.log("restarted!");
});
Hope this helps.