Cleaning up make test-client. Adding to build. (#2984)

Этот коммит содержится в:
Christopher Speller
2016-05-13 16:17:07 -04:00
родитель 39b520e38e
Коммит 587ddde587
7 изменённых файлов: 87 добавлений и 157 удалений

Просмотреть файл

@@ -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;