Skip to content

Commit

Permalink
fix(build): add react minification support
Browse files Browse the repository at this point in the history
Fix #2110
Close #2754
  • Loading branch information
filipesilva committed Oct 18, 2016
1 parent 02d8d66 commit e23e0fe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
1 change: 1 addition & 0 deletions packages/angular-cli/models/webpack-build-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export function getWebpackCommonConfig(
crypto: 'empty',
tls: 'empty',
net: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
Expand Down
9 changes: 0 additions & 9 deletions packages/angular-cli/models/webpack-build-development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ export const getWebpackDevConfigPartial = function(projectRoot: string, appConfi
filename: '[name].bundle.js',
sourceMapFilename: '[name].map',
chunkFilename: '[id].chunk.js'
},
node: {
fs: 'empty',
global: true,
crypto: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
}
};
};
14 changes: 4 additions & 10 deletions packages/angular-cli/models/webpack-build-production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
},
plugins: [
new WebpackMd5Hash(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new webpack.optimize.UglifyJsPlugin(<any>{
mangle: { screw_ie8 : true },
compress: { screw_ie8: true },
Expand Down Expand Up @@ -54,15 +57,6 @@ export const getWebpackProdConfigPartial = function(projectRoot: string, appConf
]
}
})
],
node: {
fs: 'empty',
global: true,
crypto: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
}
]
};
};
4 changes: 3 additions & 1 deletion packages/angular-cli/models/webpack-build-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ const getWebpackTestConfig = function (projectRoot, environment, appConfig) {
node: {
fs: 'empty',
global: true,
process: false,
crypto: 'empty',
tls: 'empty',
net: 'empty',
process: true,
module: false,
clearImmediate: false,
setImmediate: false
Expand Down

0 comments on commit e23e0fe

Please sign in to comment.