diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-05-13 16:17:07 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-13 16:17:07 -0400 |
commit | 587ddde5876c14e2617cc341d8e5a13195cc0105 (patch) | |
tree | 4f1822636a131f62f18766a856024ebc40963c85 /webapp/webpack.config-test.js | |
parent | 39b520e38e0b4812819397a6163b0de308cc6260 (diff) | |
download | chat-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-test.js')
-rw-r--r-- | webapp/webpack.config-test.js | 131 |
1 files changed, 0 insertions, 131 deletions
diff --git a/webapp/webpack.config-test.js b/webapp/webpack.config-test.js deleted file mode 100644 index aaeefeb8c..000000000 --- a/webapp/webpack.config-test.js +++ /dev/null @@ -1,131 +0,0 @@ -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'); - -const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-process-env - -var DEV = true; -var FULLMAP = false; -if (NPM_TARGET === 'run' || NPM_TARGET === 'run-fullmap') { - DEV = true; - if (NPM_TARGET === 'run-fullmap') { - FULLMAP = true; - } -} - -var config = { - target: 'node', - externals: [nodeExternals()], - module: { - loaders: [ - { - test: /\.jsx?$/, - loader: 'babel', - exclude: /(node_modules|non_npm_dependencies)/, - query: { - presets: ['react', 'es2015-webpack', 'stage-0'], - plugins: ['transform-runtime'], - cacheDirectory: DEV - } - }, - { - test: /\.json$/, - loader: 'json' - }, - { - test: /(node_modules|non_npm_dependencies)\/.+\.(js|jsx)$/, - loader: 'imports', - query: { - $: 'jquery', - jQuery: 'jquery' - } - }, - { - test: /\.scss$/, - loaders: ['style', 'css', 'sass'] - }, - { - test: /\.css$/, - loaders: ['style', 'css'] - }, - { - test: /\.(png|eot|tiff|svg|woff2|woff|ttf|gif|mp3|jpg)$/, - loader: 'file', - query: { - name: 'files/[hash].[ext]' - } - }, - { - test: /\.html$/, - loader: htmlExtract.extract('html?attrs=link:href') - } - ] - }, - sassLoader: { - includePaths: ['node_modules/compass-mixins/lib'] - }, - plugins: [ - new webpack.ProvidePlugin({ - 'window.jQuery': 'jquery' - }), - htmlExtract, - new CopyWebpackPlugin([ - {from: 'images/emoji', to: 'emoji'} - ]), - new webpack.LoaderOptionsPlugin({ - minimize: !DEV, - debug: false - }) - ], - resolve: { - alias: { - jquery: 'jquery/dist/jquery' - }, - modules: [ - 'node_modules', - 'non_npm_dependencies', - path.resolve(__dirname) - ] - } -}; - -// Development mode configuration -if (DEV) { - if (FULLMAP) { - config.devtool = 'source-map'; - } else { - config.devtool = 'eval-cheap-module-source-map'; - } -} - -// Production mode configuration -if (!DEV) { - config.devtool = 'source-map'; - config.plugins.push( - new webpack.optimize.UglifyJsPlugin({ - 'screw-ie8': true, - mangle: { - toplevel: false - }, - compress: { - warnings: false - }, - comments: false - }) - ); - config.plugins.push( - new webpack.optimize.AggressiveMergingPlugin() - ); - config.plugins.push( - new webpack.optimize.OccurrenceOrderPlugin(true) - ); - config.plugins.push( - new webpack.optimize.DedupePlugin() - ); -} - -module.exports = config; |