forked from javascript-tutorial/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodemon.js
More file actions
executable file
·28 lines (25 loc) · 911 Bytes
/
nodemon.js
File metadata and controls
executable file
·28 lines (25 loc) · 911 Bytes
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
const nodemon = require('nodemon');
module.exports = async function(options) {
nodemon({
// shared client/server code has require('template.pug) which precompiles template on run
// so I have to restart server to pickup the template change
ext: "js",
verbose: true,
delay: 10,
nodeArgs: process.env.NODE_DEBUG ? ['--inspect'] : [],
script: "./bin/server.js",
//ignoreRoot: ['.git', 'node_modules'].concat(glob.sync('{handlers,modules}/**/client')), // ignore handlers' client code
ignore: ['**/client/', '**/photoCut/', 'public'], // ignore handlers' client code
watch: ["modules"],
watchOptions: {
awaitWriteFinish: {
stabilityThreshold: 300,
pollInterval: 100
}
}
})
.on('log', function(log) {
console.log(log.colour);
});
await new Promise(resolve => {});
};