diff --git a/packages/angular-cli/models/webpack-build-common.ts b/packages/angular-cli/models/webpack-build-common.ts index 1a94f030eef3..aae14af6663c 100644 --- a/packages/angular-cli/models/webpack-build-common.ts +++ b/packages/angular-cli/models/webpack-build-common.ts @@ -139,6 +139,7 @@ export function getWebpackCommonConfig( crypto: 'empty', tls: 'empty', net: 'empty', + process: true, module: false, clearImmediate: false, setImmediate: false diff --git a/packages/angular-cli/models/webpack-build-development.ts b/packages/angular-cli/models/webpack-build-development.ts index 4dbaf65e116b..ed5305df709f 100644 --- a/packages/angular-cli/models/webpack-build-development.ts +++ b/packages/angular-cli/models/webpack-build-development.ts @@ -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 } }; }; diff --git a/packages/angular-cli/models/webpack-build-production.ts b/packages/angular-cli/models/webpack-build-production.ts index cce93ab7868a..3ff408ad9a07 100644 --- a/packages/angular-cli/models/webpack-build-production.ts +++ b/packages/angular-cli/models/webpack-build-production.ts @@ -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({ mangle: { screw_ie8 : true }, compress: { screw_ie8: true }, @@ -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 - } + ] }; }; diff --git a/packages/angular-cli/models/webpack-build-test.js b/packages/angular-cli/models/webpack-build-test.js index 2aef8b397940..9d3262f30138 100644 --- a/packages/angular-cli/models/webpack-build-test.js +++ b/packages/angular-cli/models/webpack-build-test.js @@ -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