1
0
mirror of synced 2025-11-08 12:57:47 +00:00

feat(watch): use concurrently for the watch task

Fixes #11
This commit is contained in:
Jason Dreyzehner
2017-02-28 21:52:24 -05:00
parent 7f9492ba07
commit 7fa64b8a5a
4 changed files with 186 additions and 40 deletions

View File

@@ -27,11 +27,15 @@ const makeTransform = (filePath, buildPath) => {
// copy, then watch for changes to the tests
const testsFromRoot = 'build/main/**/*.spec.js';
const task = process.argv[2] === '-w' ? cpx.watch : cpx.copy;
const watchMode = process.argv.indexOf('-w') !== -1 ? true : false;
const browserTests = process.argv.indexOf('--no-browser') !== -1 ? true : false;
const task = watchMode ? cpx.watch : cpx.copy;
task(testsFromRoot, 'test/main', {
transform: (filePath) => makeTransform(filePath, pkg.main)
})
task(testsFromRoot, 'test/browser', {
transform: (filePath) => makeTransform(filePath, pkg.browser.replace('.js', '.cjs.js'))
})
});
if (!browserTests) {
task(testsFromRoot, 'test/browser', {
transform: (filePath) => makeTransform(filePath, pkg.browser.replace('.js', '.cjs.js'))
});
}