mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
30 lines
658 B
TypeScript
30 lines
658 B
TypeScript
import { defineConfig } from 'umi';
|
|
const CompressionPlugin = require('compression-webpack-plugin');
|
|
|
|
export default defineConfig({
|
|
hash: true,
|
|
layout: false,
|
|
nodeModulesTransform: {
|
|
type: 'none',
|
|
},
|
|
fastRefresh: {},
|
|
favicon: 'https://image.whyour.cn/others/g5.ico',
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:5678/',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
chainWebpack(memo) {
|
|
memo.plugin('CompressionPlugin').use(
|
|
new CompressionPlugin({
|
|
filename: '[path][base].gz',
|
|
algorithm: 'gzip',
|
|
test: /\.js$|\.css$|\.html$/,
|
|
threshold: 10240,
|
|
minRatio: 0.8,
|
|
}),
|
|
);
|
|
},
|
|
});
|