-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodemon.js
31 lines (28 loc) · 826 Bytes
/
nodemon.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var nodemon = require('nodemon');
var { exec } = require('child_process');
nodemon({
script: 'server.js',
ext: 'js jsx ts tsx html json css scss' ,
ignore : [
".git",
"./nodemon.js",
"./server.js",
//"./socket-server.js",
"./webpack.config.js",
"./dist/server.js" ,
"./dist/scripts/app.bundle.js" ,
"./dist/*" ,
]
});
// WebPack Compile-Transpile Command for dev
let cmd = "webpack --mode development -c webpack.config.js webpack.config.server.js";
nodemon.on('start', function () {
// Execute WebPack Compile
exec( cmd , (err, stdout, stderr) => {});
console.log('> Nodemon has started');
}).on('quit', function () {
console.log('> Nodemon has quit');
process.exit();
}).on('restart', function (files) {
console.log('> Nodemon restarted due to change(s): ', files);
});