aboutsummaryrefslogtreecommitdiff
path: root/webpack.prod.js
blob: 626c0df2196f8e4917e3ec318621907c576b8bfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin')
const common = require('./webpack.common.js')
const webpack = require('webpack')
const { merge } = require('webpack-merge')

module.exports = merge(common, {
    mode: 'production',
    stats: 'errors-only',
    // devtool: 'source-map',
    optimization: {
        minimize: true,
        minimizer: [
            new webpack.DefinePlugin({
                __VUE_OPTIONS_API__: 'true',
                __VUE_PROD_DEVTOOLS__: 'false',
                __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false'
            }),
            new TerserPlugin(
                {
                    extractComments: false
                }
            ),
            new CssMinimizerPlugin({
                minimizerOptions: {
                    preset: [ 'default', { discardComments: { removeAll: true } } ],
                },
            }),
        ]
    }
})