Skip to content

Commit 9672aef

Browse files
filipesilvakieronqtran
authored andcommitted
fix(build): add react minification support
Fix angular#2110 Close angular#2754
1 parent 88e519b commit 9672aef

File tree

4 files changed

+8
-20
lines changed

4 files changed

+8
-20
lines changed

packages/angular-cli/models/webpack-build-common.ts

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export function getWebpackCommonConfig(
139139
crypto: 'empty',
140140
tls: 'empty',
141141
net: 'empty',
142+
process: true,
142143
module: false,
143144
clearImmediate: false,
144145
setImmediate: false

packages/angular-cli/models/webpack-build-development.ts

-9
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ export const getWebpackDevConfigPartial = function(projectRoot: string, appConfi
88
filename: '[name].bundle.js',
99
sourceMapFilename: '[name].map',
1010
chunkFilename: '[id].chunk.js'
11-
},
12-
node: {
13-
fs: 'empty',
14-
global: true,
15-
crypto: 'empty',
16-
process: true,
17-
module: false,
18-
clearImmediate: false,
19-
setImmediate: false
2011
}
2112
};
2213
};

packages/angular-cli/models/webpack-build-production.ts

+4-10
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
2424
},
2525
plugins: [
2626
new WebpackMd5Hash(),
27+
new webpack.DefinePlugin({
28+
'process.env.NODE_ENV': JSON.stringify('production')
29+
}),
2730
new webpack.optimize.UglifyJsPlugin(<any>{
2831
mangle: { screw_ie8 : true },
2932
compress: { screw_ie8: true },
@@ -54,15 +57,6 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
5457
]
5558
}
5659
})
57-
],
58-
node: {
59-
fs: 'empty',
60-
global: true,
61-
crypto: 'empty',
62-
process: true,
63-
module: false,
64-
clearImmediate: false,
65-
setImmediate: false
66-
}
60+
]
6761
};
6862
};

packages/angular-cli/models/webpack-build-test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ const getWebpackTestConfig = function (projectRoot, environment, appConfig) {
111111
node: {
112112
fs: 'empty',
113113
global: true,
114-
process: false,
115114
crypto: 'empty',
115+
tls: 'empty',
116+
net: 'empty',
117+
process: true,
116118
module: false,
117119
clearImmediate: false,
118120
setImmediate: false

0 commit comments

Comments
 (0)