Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Prevent watch mode from breaking `npm run build`

Jo Spragued72c403fd53e
diff --git a/package.json b/package.json
index c58b73cbd..bbf961ef7 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
"test:end": "run-script-os",
"test:end:darwin:linux": "pkill -f buster-server",
"test:end:win32": "tskill node",
- "watch": "npm-watch"
+ "watch": "WORLDVIEW_WATCH='active' npm-watch"
},
"watch": {
"build:css": {
@@ -45,7 +45,7 @@
],
"extensions": "css"
},
- "build:js": "This task self-watches as long as $NODE_ENV=development"
+ "build:js": "This task self-watches as long as $WORLDVIEW_WATCH=active"
},
"devDependencies": {
"autoprefixer": "7.1.1",
diff --git a/tasks/buildJS.js b/tasks/buildJS.js
index 27264def6..c12caca6d 100644
--- a/tasks/buildJS.js
+++ b/tasks/buildJS.js
@@ -6,6 +6,7 @@ const minimist = require('minimist');
const argv = minimist(process.argv.slice(2));
const isDebug = process.env.NODE_ENV === 'development';
+const isWatching = process.env.WORLDVIEW_WATCH === 'active';
const isTest = argv.tests;
const entryPoint = isTest ? './test/main.js' : './web/js/main.js';
@@ -17,7 +18,7 @@ var bundler = browserify(entryPoint, {
fullPaths: isDebug, // For use with https://www.npmjs.com/package/disc
cache: {}, // Required for watchify
packageCache: {}, // Required for watchify
- plugin: [isDebug ? watchify : null]
+ plugin: [isWatching ? watchify : null]
}).transform('babelify', {
presets: ['env']
}).transform('browserify-shim', {