2020-02-04 17:20:39 +01:00
|
|
|
const common = require('./webpack.common.js')
|
|
|
|
const merge = require('webpack-merge')
|
|
|
|
const path = require('path')
|
|
|
|
const webpack = require('webpack')
|
|
|
|
const CleanWebpackPlugin = require('clean-webpack-plugin')
|
|
|
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
|
|
|
|
|
|
|
module.exports = merge(common, {
|
|
|
|
mode: 'production',
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
publicPath: '/',
|
|
|
|
filename: '[name].[chunkhash].js'
|
|
|
|
},
|
|
|
|
devtool: 'source-map',
|
|
|
|
plugins: [
|
|
|
|
new CleanWebpackPlugin({dir: ['dist'] }),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env.NODE_ENV': JSON.stringify('production')
|
|
|
|
}),
|
2020-03-26 11:09:29 +01:00
|
|
|
// new UglifyJSPlugin({
|
|
|
|
// sourceMap: true
|
|
|
|
// })
|
2020-02-04 17:20:39 +01:00
|
|
|
]
|
|
|
|
})
|