| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- const CompressionWebpackPlugin = require('compression-webpack-plugin');
- const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
- module.exports = {
- productionSourceMap: false,
- configureWebpack: {
- performance: {
- maxAssetSize: 2000000,
- maxEntrypointSize: 2000000
- }
- },
- chainWebpack(config) {
- config.plugins.delete('prefetch');
- if (process.env.NODE_ENV !== 'development') {
- // gzip 压缩
- config.plugin('compressionPlugin').use(
- new CompressionWebpackPlugin({
- test: /\.(js|css|html)$/,
- threshold: 10240
- })
- );
- }
- },
- css: {
- loaderOptions: {
- sass: {
- sassOptions: {
- outputStyle: 'expanded',
- importer: transformElementScss()
- }
- }
- }
- },
- devServer: { //liu
- proxy: {
- '/kingdom': {
- target: 'http://192.168.3.51:18086',
- // target: 'http://192.168.3.35:8080', // kang杨威
- // target: 'http://192.168.3.31:8080', // 黄峥嵘
- changeOrigin: true,
- pathRewrite: {
- "^/kingdom": '',
- }
- },
- },
- },
- };
|