Browse Source

better nodemon usage #851 (#852)

pull/1/head
jonyrock-back 5 years ago committed by GitHub
parent
commit
190005184c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      server/build/dev-server.js

16
server/build/dev-server.js

@ -1,4 +1,5 @@
const { spawn } = require('child_process'); const { spawn } = require('child_process');
const nodemon = require('nodemon');
const webpack = spawn('webpack', ['--config', 'build/webpack.dev.conf.js'], { const webpack = spawn('webpack', ['--config', 'build/webpack.dev.conf.js'], {
stdio: 'inherit', stdio: 'inherit',
@ -8,12 +9,9 @@ const webpack = spawn('webpack', ['--config', 'build/webpack.dev.conf.js'], {
var env = Object.create(process.env); var env = Object.create(process.env);
env.LOG_LEVEL = 'debug'; env.LOG_LEVEL = 'debug';
const nodemon = spawn( nodemon({ env, script: 'dist/server-dev.js' })
'nodemon', .on('start', function () {
['--exec', '"node --inspect dist/server-dev.js"'], console.log('nodemon started');
{ env: env, shell: true } }).on('crash', function () {
); console.log('hastic-server crashed');
});
nodemon.stdout.pipe(process.stdout);
nodemon.stderr.pipe(process.stderr);

Loading…
Cancel
Save