summaryrefslogtreecommitdiffstats
path: root/webapp/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/webpack.config.js')
-rw-r--r--webapp/webpack.config.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/webapp/webpack.config.js b/webapp/webpack.config.js
index 6471731eb..224d67014 100644
--- a/webapp/webpack.config.js
+++ b/webapp/webpack.config.js
@@ -2,6 +2,7 @@ const webpack = require('webpack');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
+const nodeExternals = require('webpack-node-externals');
const htmlExtract = new ExtractTextPlugin('html', 'root.html');
@@ -9,6 +10,7 @@ const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-pro
var DEV = false;
var FULLMAP = false;
+var TEST = false;
if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') {
DEV = true;
if (NPM_TARGET === 'run-fullmap') {
@@ -16,6 +18,11 @@ if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') {
}
}
+if (NPM_TARGET === 'test') {
+ DEV = false;
+ TEST = true;
+}
+
var config = {
entry: ['babel-polyfill', './root.jsx', 'root.html'],
output: {
@@ -139,4 +146,9 @@ if (!DEV) {
);
}
+// Test mode configuration
+if (TEST) {
+ config.externals = [nodeExternals()];
+}
+
module.exports = config;