summaryrefslogtreecommitdiffstats
path: root/webapp/webpack.config.js
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-05-13 16:17:07 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-13 16:17:07 -0400
commit587ddde5876c14e2617cc341d8e5a13195cc0105 (patch)
tree4f1822636a131f62f18766a856024ebc40963c85 /webapp/webpack.config.js
parent39b520e38e0b4812819397a6163b0de308cc6260 (diff)
downloadchat-587ddde5876c14e2617cc341d8e5a13195cc0105.tar.gz
chat-587ddde5876c14e2617cc341d8e5a13195cc0105.tar.bz2
chat-587ddde5876c14e2617cc341d8e5a13195cc0105.zip
Cleaning up make test-client. Adding to build. (#2984)
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;