123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- var TerserPlugin = require("terser-webpack-plugin");
- var CompressionPlugin = require("compression-webpack-plugin");
- var devProxy = {
- "/api/": {
- target: process.env.VUE_APP_DEV_PROXY,
- changeOrigin: true
- }
- };
- var config = {
-
- productionSourceMap: false,
- devServer: {
- port: 8076,
- proxy: devProxy
- },
- transpileDependencies: ["vue-echarts", "resize-detector"],
- chainWebpack: config => {
-
-
-
-
-
-
-
- }
- };
- if (process.env.NODE_ENV === "production") {
- config.configureWebpack = {
- plugins: [
-
- new CompressionPlugin({
- filename: "[path].gz[query]",
- algorithm: "gzip",
- test: new RegExp("\\.(js|css)$"),
- threshold: 10240,
- minRatio: 0.8
- })
- ],
- optimization: {
- minimizer: [
- new TerserPlugin({
- terserOptions: { compress: { drop_console: true } }
- })
- ]
- }
- };
- }
- config.css = {
- loaderOptions: {
- less: {
- javascriptEnabled: true
- }
- }
- };
- module.exports = config;
|