From 1c7effb25f9eb7a597d0339d1a64b88c0e11a02a Mon Sep 17 00:00:00 2001 From: YILI Date: Wed, 22 Mar 2017 14:52:56 +0800 Subject: Modify some configuration for build modify config, i18n package.json tsconfig.json files content deleted typing.json file Issue-ID:CLIENT-164 Change-Id: Ifcaa9a53692ed79d58da84553ad4ccd1bb590d1b Signed-off-by: YILI --- .../src/main/webapp/config/webpack.prod.js | 119 +++++++++++++++------ 1 file changed, 88 insertions(+), 31 deletions(-) (limited to 'alarm-analysis/src/main/webapp/config/webpack.prod.js') diff --git a/alarm-analysis/src/main/webapp/config/webpack.prod.js b/alarm-analysis/src/main/webapp/config/webpack.prod.js index 11920244..d6ddc420 100644 --- a/alarm-analysis/src/main/webapp/config/webpack.prod.js +++ b/alarm-analysis/src/main/webapp/config/webpack.prod.js @@ -12,41 +12,98 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -var webpack = require('webpack'); -var webpackMerge = require('webpack-merge'); -var ExtractTextPlugin = require('extract-text-webpack-plugin'); -var commonConfig = require('./webpack.common.js'); -var helpers = require('./helpers'); +const ExtractTextPlugin = require('extract-text-webpack-plugin'); +const DefinePlugin = require('webpack/lib/DefinePlugin'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); +const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin'); +const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin'); + + +const webpack = require('webpack'); +const commonConfig = require('./webpack.common.js'); +const webpackMerge = require('webpack-merge'); +const helpers = require('./helpers'); -const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; module.exports = webpackMerge(commonConfig, { - devtool: 'source-map', - - output: { - path: helpers.root('dist'), - publicPath: '/', - filename: '[name].[hash].js', - chunkFilename: '[id].[hash].chunk.js' - }, - - htmlLoader: { - minimize: false - }, - - plugins: [ - new webpack.NoErrorsPlugin(), - new webpack.optimize.DedupePlugin(), - new webpack.optimize.UglifyJsPlugin({ - mangle: { - keep_fnames: true + + + devtool: 'source-map', + + + output: { + + path: helpers.root('holmes'), + + filename: '[name].[chunkhash].bundle.js',//'[name].[hash].js', + + sourceMapFilename: '[name].[chunkhash].bundle.map', + + + chunkFilename: '[id].[chunkhash].chunk.js'//'[id].[hash].chunk.js' + }, + + + + + module: { + + rules: [ + + { + test: /\.css$/, + loader: ExtractTextPlugin.extract({ + fallback: 'style-loader', + use: { + loader: 'css-loader', + options: { + sourceMap: true, + minimize: true } + } }), - new ExtractTextPlugin('[name].[hash].css'), - new webpack.DefinePlugin({ - 'process.env': { - 'ENV': JSON.stringify(ENV) - } - }) + include: [helpers.root('alarm/assets'), helpers.root('public'),helpers.root('alarm/app')] + }, ] + + }, + + plugins: [ + + new webpack.NoErrorsPlugin(), + + new webpack.optimize.DedupePlugin(), + + new webpack.optimize.UglifyJsPlugin({ + sourceMap: true, + mangle: { + keep_fnames: true + } + }), + + + new ExtractTextPlugin('[name].[contenthash].css'), + + new DefinePlugin({ + 'CONST': true, + }), + + + new LoaderOptionsPlugin({ + minimize: true, + debug: false, + }) + ], + + + node: { + global: true, + crypto: 'empty', + process: false, + module: false, + clearImmediate: false, + setImmediate: false + } + + }); -- cgit 1.2.3-korg