nunta/scripts/start.js

24 lines
676 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 scripts/sb-watch.js', name: 'SB_WATCH', prefixColor: 'bgBlue.bold' },
{
2020-04-07 00:19:58 +02:00
command: `"${browserSyncPath}" --reload-delay 2000 --reload-debounce 2000 dist -w --no-online`,
name: 'SB_BROWSER_SYNC',
2020-04-07 00:19:58 +02:00
prefixColor: 'bgGreen.bold',
}
], {
prefix: 'name',
killOthers: ['failure', 'success'],
}).then(success, failure);
function success() {
console.log('Success');
2020-04-07 00:19:58 +02:00
}
function failure() {
console.log('Failure');
}