Skip to content

Instantly share code, notes, and snippets.

@afucher
Created December 21, 2016 16:32
Show Gist options
  • Save afucher/b542972b551b43616f95b28bc360f9e3 to your computer and use it in GitHub Desktop.
Save afucher/b542972b551b43616f95b28bc360f9e3 to your computer and use it in GitHub Desktop.
const webpack = require('webpack');
const compiler = webpack(require('./webpack.config'));
compiler.watch({ // watch options:
aggregateTimeout: 300, // wait so long for more changes
poll: true // use polling instead of native watchers
// pass a number to set the polling interval
}, function(err, stats) {
console.log(stats.toString());
});
const nodemon = require('nodemon');
nodemon({
script: 'index.js',
ext: 'js json'
});
nodemon.on('start', function () {
console.log('App has started');
}).on('quit', function () {
console.log('App has quit');
}).on('restart', function (files) {
console.log('App restarted due to: ', files);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment