mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-25 02:57:31 +00:00
In Angular2Spa webpack config, use "--env.prod" arg to trigger prod builds instead of ASPNETCORE_ENVIRONMENT env var. This is to guarantee production mode when publishing.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
var isDevBuild = process.argv.indexOf('--env.prod') < 0;
|
||||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
var extractCSS = new ExtractTextPlugin('vendor.css');
|
||||
var isDevelopment = process.env.ASPNETCORE_ENVIRONMENT === 'Development';
|
||||
|
||||
module.exports = {
|
||||
resolve: {
|
||||
@@ -47,7 +47,7 @@ module.exports = {
|
||||
path: path.join(__dirname, 'wwwroot', 'dist', '[name]-manifest.json'),
|
||||
name: '[name]_[hash]'
|
||||
})
|
||||
].concat(isDevelopment ? [] : [
|
||||
].concat(isDevBuild ? [] : [
|
||||
new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } })
|
||||
])
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user