Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Commit e0763ad

Browse files
chore(webpack): simplify plugins in production build
1 parent 01dc578 commit e0763ad

File tree

1 file changed

+2
-62
lines changed

1 file changed

+2
-62
lines changed

webpack.config.prod.js

+2-62
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,6 @@ var config = {
7171

7272
new webpack.DefinePlugin(common.buildDefines()),
7373

74-
// Until loaders are updated, use the LoaderOptionsPlugin to pass custom properties to third-party loaders
75-
new webpack.LoaderOptionsPlugin({
76-
77-
// Put loaders into debug mode
78-
// Note: this will be deprecated in v3 or later. Remove when loaders will update.
79-
debug: false,
80-
81-
// Put loaders into minimize mode.
82-
// Note: this will be deprecated in v3 or later. Remove when loaders will update.
83-
minimize: true,
84-
85-
}),
86-
8774
// Provides context to Angular's use of System.import
8875
new webpack.ContextReplacementPlugin(
8976
common.patterns.angularContext,
@@ -94,7 +81,7 @@ var config = {
9481
new webpack.optimize.CommonsChunkPlugin({
9582
name: ['main', 'vendor'],
9683
filename: common.relPaths.bundleJs,
97-
minChunks: mod => /node_modules/.test(mod.resource),
84+
minChunks: mod => common.patterns.nodeModules.test(mod.resource),
9885
}),
9986

10087
new ExtractTextPlugin(common.relPaths.bundleCss),
@@ -107,54 +94,7 @@ var config = {
10794
}),
10895

10996
// Minimize scripts
110-
new webpack.optimize.UglifyJsPlugin({
111-
sourceMap: true,
112-
113-
// to debug production build, uncomment lines in [debug] section and comment lines in [prod] section
114-
115-
// [prod]: Settings for production build
116-
beautify: false,
117-
mangle: {
118-
screw_ie8 : true,
119-
keep_fnames: true,
120-
},
121-
comments: false,
122-
compress: {
123-
warnings: false,
124-
screw_ie8: true,
125-
drop_debugger: true,
126-
drop_console: false, //true,
127-
dead_code: true,
128-
unused: true,
129-
conditionals: true,
130-
comparisons: true,
131-
sequences: true,
132-
evaluate: true,
133-
if_return: true,
134-
join_vars: true,
135-
},
136-
137-
// [debug]: Settings when debugging production build
138-
/*
139-
beautify: true,
140-
mangle: false,
141-
comments: true,
142-
compress: {
143-
warnings: true,
144-
screw_ie8: false,
145-
drop_debugger: false,
146-
drop_console: false,
147-
dead_code: false,
148-
unused: false,
149-
conditionals: false,
150-
comparisons: false,
151-
sequences: false,
152-
evaluate: false,
153-
if_return: false,
154-
join_vars: false,
155-
},
156-
*/
157-
}),
97+
new webpack.optimize.UglifyJsPlugin(),
15898

15999
// Only emit files when there are no errors
160100
new webpack.NoEmitOnErrorsPlugin(),

0 commit comments

Comments
 (0)