nunta/scripts/start-debug.js

24 lines
640 B
JavaScript
Raw Normal View History

2020-04-07 00:19:58 +02:00
const concurrently = require('concurrently');
const upath = require('upath');
2020-04-07 00:19:58 +02:00
const browserSyncPath = upath.resolve(upath.dirname(__filename), '../node_modules/.bin/browser-sync');
2020-04-07 00:19:58 +02:00
concurrently([
{ command: 'node --inspect scripts/sb-watch.js', name: 'SB_WATCH', prefixColor: 'bgBlue.bold' },
{
command: `${browserSyncPath} dist -w --no-online`,
name: 'SB_BROWSER_SYNC',
prefixColor: 'bgBlue.bold',
}
], {
prefix: 'name',
killOthers: ['failure', 'success'],
}).then(success, failure);
function success() {
console.log('Success');
}
function failure() {
console.log('Failure');
}