1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- var CompressionPlugin = require('compression-webpack-plugin');
- const TerserPlugin = require('terser-webpack-plugin');
- module.exports = {
- publicPath: process.env.NODE_ENV === 'production'
- ? '/'
- : '/',
- outputDir: 'dist',
- lintOnSave: false,
- devServer: {
-
- hot: true,
- disableHostCheck: true,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- },
- productionSourceMap: false,
- configureWebpack: {
- plugins: [
- new CompressionPlugin({
- algorithm: 'gzip',
- test: /\.js$|\.css$/,
- filename: '[path][base].gz',
- minRatio: 1,
- threshold: 10240,
- deleteOriginalAssets: false,
- }),
- ],
- optimization: {
-
- minimizer: [
- new TerserPlugin({
- terserOptions: {
- ecma: undefined,
- warnings: false,
- parse: {},
- compress: {
- drop_console: true,
- drop_debugger: true,
- pure_funcs: ['console.log']
- }
- },
- }),
- ]
- }
- }
- }
|