diff options
author | YILI <li.yi101@zte.com.cn> | 2017-03-22 14:52:56 +0800 |
---|---|---|
committer | 6092002077 <li.yi101@zte.com.cn> | 2017-03-22 14:52:56 +0800 |
commit | 1c7effb25f9eb7a597d0339d1a64b88c0e11a02a (patch) | |
tree | 46a8e3a2735171b66c2287849ba0f9a1c336495c /alarm-analysis/src/main/webapp/config/webpack.prod.js | |
parent | 3d2fa1dc4692c869cf54a3c53288f3a5783588b3 (diff) |
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 <li.yi101@zte.com.cn>
Diffstat (limited to 'alarm-analysis/src/main/webapp/config/webpack.prod.js')
-rw-r--r-- | alarm-analysis/src/main/webapp/config/webpack.prod.js | 119 |
1 files changed, 88 insertions, 31 deletions
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
+ }
+
+
});
|