@@ -34,27 +34,28 @@ import {
3434import head from './config/head' ;
3535import meta from './config/meta' ;
3636
37- const { ContextReplacementPlugin } = require ( 'webpack' ) ;
38- const { DefinePlugin } = require ( 'webpack' ) ;
39- const { DllPlugin } = require ( 'webpack' ) ;
40- const { DllReferencePlugin } = require ( 'webpack' ) ;
41- const { NoErrorsPlugin } = require ( 'webpack' ) ;
42- const { ProgressPlugin } = require ( 'webpack' ) ;
43-
44- const CommonsChunkPlugin = require ( 'webpack/lib/optimize/CommonsChunkPlugin' ) ;
45- const LoaderOptionsPlugin = require ( 'webpack/lib/LoaderOptionsPlugin' ) ;
46- const NamedModulesPlugin = require ( 'webpack/lib/NamedModulesPlugin' ) ;
47- const OccurrenceOrderPlugin = require ( 'webpack/lib/optimize/OccurrenceOrderPlugin' ) ;
48- const UglifyJsPlugin = require ( 'webpack/lib/optimize/UglifyJsPlugin' ) ;
49-
50- const { ForkCheckerPlugin } = require ( 'awesome-typescript-loader' ) ;
51- const CompressionPlugin = require ( 'compression-webpack-plugin' ) ;
52- const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
53- const HtmlElementsPlugin = require ( './config/html-elements-plugin' ) ;
54- const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
55- const ngtools = require ( '@ngtools/webpack' ) ;
56- const WebpackMd5Hash = require ( 'webpack-md5-hash' ) ;
57- const webpackMerge = require ( 'webpack-merge' ) ;
37+ const { ContextReplacementPlugin } = require ( 'webpack' ) ;
38+ const { DefinePlugin } = require ( 'webpack' ) ;
39+ const { DllPlugin } = require ( 'webpack' ) ;
40+ const { DllReferencePlugin } = require ( 'webpack' ) ;
41+ const { NoErrorsPlugin } = require ( 'webpack' ) ;
42+ const { ProgressPlugin } = require ( 'webpack' ) ;
43+
44+ const LoaderOptionsPlugin = require ( 'webpack/lib/LoaderOptionsPlugin' ) ;
45+ const NamedModulesPlugin = require ( 'webpack/lib/NamedModulesPlugin' ) ;
46+
47+ const CommonsChunkPlugin = require ( 'webpack/lib/optimize/CommonsChunkPlugin' ) ;
48+ const OccurrenceOrderPlugin = require ( 'webpack/lib/optimize/OccurrenceOrderPlugin' ) ;
49+ const MinChunkSizePlugin = require ( 'webpack/lib/optimize/MinChunkSizePlugin' ) ;
50+
51+ const { ForkCheckerPlugin } = require ( 'awesome-typescript-loader' ) ;
52+ const CompressionPlugin = require ( 'compression-webpack-plugin' ) ;
53+ const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
54+ const HtmlElementsPlugin = require ( './config/html-elements-plugin' ) ;
55+ const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
56+ const ngtools = require ( '@ngtools/webpack' ) ;
57+ const WebpackMd5Hash = require ( 'webpack-md5-hash' ) ;
58+ const webpackMerge = require ( 'webpack-merge' ) ;
5859
5960const EVENT = process . env . npm_lifecycle_event ;
6061const ENV = process . env . NODE_ENV || 'development' ;
@@ -296,32 +297,6 @@ const prodConfig = function () {
296297 config . plugins = [
297298 // new NoErrorsPlugin(),
298299 new WebpackMd5Hash ( ) ,
299- new UglifyJsPlugin ( {
300- // beautify: true, //debug
301- // mangle: false, //debug
302- // dead_code: false, //debug
303- // unused: false, //debug
304- // deadCode: false, //debug
305- // compress: {
306- // screw_ie8: true,
307- // keep_fnames: true,
308- // drop_debugger: false,
309- // dead_code: false,
310- // unused: false
311- // }, // debug
312- // comments: true, //debug
313-
314-
315- beautify : false ,
316- mangle : {
317- screw_ie8 : true ,
318- keep_fnames : true ,
319- } ,
320- compress : {
321- screw_ie8 : true ,
322- } ,
323- comments : false ,
324- } ) ,
325300 new CompressionPlugin ( {
326301 asset : '[path].gz[query]' ,
327302 algorithm : 'gzip' ,
@@ -335,6 +310,9 @@ const prodConfig = function () {
335310 new CommonsChunkPlugin ( {
336311 name : [ 'polyfills' , 'vendors' , 'rxjs' ] . reverse ( ) ,
337312 } ) ,
313+ new MinChunkSizePlugin ( {
314+ minChunkSize : 10000 ,
315+ } ) ,
338316 new CopyWebpackPlugin ( COPY_FOLDERS ) ,
339317 new HtmlWebpackPlugin ( {
340318 template : `src/index.html` ,
0 commit comments