"npm run build" now builds an artifact optimized for production use. The removes dead code, and minizes the result. The size of the bundle shrinks from about 14MB to 2MB. The previous build command is moved to "npm run build:dev". Change-Id: I21430f06049c4eeeb4a66c7143da8c2919fb5a24 Closes-Bug: 1688610
25 lines
538 B
JavaScript
25 lines
538 B
JavaScript
const webpack = require('webpack');
|
|
const merge = require('webpack-merge');
|
|
const CommonConfig = require('./webpack.common.js');
|
|
|
|
module.exports = env => {
|
|
return merge(CommonConfig, {
|
|
devtool: 'source-map',
|
|
devServer: {
|
|
contentBase: './dist',
|
|
host: '0.0.0.0',
|
|
port: 3000,
|
|
stats: {
|
|
colors: true
|
|
},
|
|
historyApiFallback: true,
|
|
inline: true
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({
|
|
'process.env.NODE_ENV': JSON.stringify('development')
|
|
})
|
|
]
|
|
});
|
|
};
|