From 83086fddd0d519a458a37c07dd02b0d1972c8d05 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 14 May 2016 14:47:48 +0200 Subject: [PATCH] client/general: skip vendor JS on watch --- client/build.js | 16 +++++++++++----- client/package.json | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/client/build.js b/client/build.js index 14b59b8..0581c3a 100644 --- a/client/build.js +++ b/client/build.js @@ -129,7 +129,7 @@ function bundleJs(config) { 'babel-polyfill', ]; glob('./js/**/*.js', {}, (er, files) => { - { + if (!process.argv.includes('--no-vendor-js')) { let b = browserify(); for (let lib of external) { b.require(lib); @@ -138,7 +138,7 @@ function bundleJs(config) { b, './public/vendor.min.js', 'Bundled vendor JS', true); } - { + if (!process.argv.includes('--no-app-js')) { let outputFile = fs.createWriteStream('./public/app.min.js'); let b = browserify({debug: config.debug}); if (config.transpile) { @@ -164,7 +164,13 @@ function copyFile(source, target) { const config = getConfig(); bundleConfig(config); -bundleHtml(config); -bundleCss(); -bundleJs(config); +if (!process.argv.includes('--no-html')) { + bundleHtml(config); +} +if (!process.argv.includes('--no-css')) { + bundleCss(); +} +if (!process.argv.includes('--no-js')) { + bundleJs(config); +} copyFile('./img/favicon.png', './public/favicon.png'); diff --git a/client/package.json b/client/package.json index 3f61d62..83b33ae 100644 --- a/client/package.json +++ b/client/package.json @@ -3,7 +3,7 @@ "private": true, "scripts": { "build": "node build.js", - "watch": "watch 'npm run build' html js css img --wait=0 --ignoreDotFiles" + "watch": "watch 'npm run build -- --no-vendor-js' html js css img --wait=0 --ignoreDotFiles" }, "dependencies": { "babel-polyfill": "^6.7.4",