Skip to content

Commit

Permalink
feat(@angular/cli): add scope hoisting
Browse files Browse the repository at this point in the history
See the following links for details on scope hoisting:
https://medium.com/webpack/webpack-freelancing-log-book-week-5-7-4764be3266f5
https://medium.com/webpack/webpack-freelancing-log-book-week-8-e73811deb412

Node's global and process were also removed, since they seemed to affect
optimization gains.
  • Loading branch information
filipesilva committed May 31, 2017
1 parent 0d3d9ef commit 4f2dbed
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"typescript": "~2.3.1",
"url-loader": "^0.5.7",
"walk-sync": "^0.3.1",
"webpack": "~2.4.0",
"webpack": "webpack/webpack#next",
"webpack-dev-middleware": "^1.10.2",
"webpack-dev-server": "~2.4.5",
"webpack-merge": "^2.4.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@angular/cli/models/webpack-configs/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ export function getCommonConfig(wco: WebpackConfigOptions) {
].concat(extraPlugins),
node: {
fs: 'empty',
global: true,
global: 'empty',
crypto: 'empty',
tls: 'empty',
net: 'empty',
process: true,
process: false,
module: false,
clearImmediate: false,
setImmediate: false
Expand Down
1 change: 1 addition & 0 deletions packages/@angular/cli/models/webpack-configs/production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const getProdConfig = function (wco: WebpackConfigOptions) {
'NODE_ENV': 'production'
}),
new (<any>webpack).HashedModuleIdsPlugin(),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.optimize.UglifyJsPlugin(<any>{
mangle: { screw_ie8: true },
compress: { screw_ie8: true, warnings: buildOptions.verbose },
Expand Down
2 changes: 1 addition & 1 deletion packages/@angular/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"typescript": ">=2.0.0 <2.4.0",
"url-loader": "^0.5.7",
"walk-sync": "^0.3.1",
"webpack": "~2.4.0",
"webpack": "webpack/webpack#next",
"webpack-dev-middleware": "^1.10.2",
"webpack-dev-server": "~2.4.5",
"webpack-merge": "^2.4.0",
Expand Down

0 comments on commit 4f2dbed

Please sign in to comment.