2020-04-07 00:19:58 +02:00
|
|
|
const concurrently = require('concurrently');
|
2021-03-30 01:45:48 +02:00
|
|
|
const upath = require('upath');
|
2020-04-07 00:19:58 +02:00
|
|
|
|
2021-03-30 01:45:48 +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' },
|
2021-03-30 01:45:48 +02:00
|
|
|
{
|
2020-04-07 00:19:58 +02:00
|
|
|
command: `"${browserSyncPath}" --reload-delay 2000 --reload-debounce 2000 dist -w --no-online`,
|
2021-03-30 01:45:48 +02:00
|
|
|
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() {
|
2021-03-30 01:45:48 +02:00
|
|
|
console.log('Success');
|
2020-04-07 00:19:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function failure() {
|
|
|
|
console.log('Failure');
|
2021-03-30 01:45:48 +02:00
|
|
|
}
|