mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复upstream gzip压缩,前端公共依赖采用cdn
This commit is contained in:
@@ -15,15 +15,26 @@ export default defineConfig({
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
chainWebpack(memo) {
|
||||
memo.plugin('CompressionPlugin').use(
|
||||
chainWebpack: (config) => {
|
||||
config.plugin('compression-webpack-plugin').use(
|
||||
new CompressionPlugin({
|
||||
filename: '[path][base].gz',
|
||||
algorithm: 'gzip',
|
||||
test: /\.js$|\.css$|\.html$/,
|
||||
test: new RegExp('\\.(js|css)$'),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8,
|
||||
minRatio: 0.6,
|
||||
}),
|
||||
);
|
||||
},
|
||||
externals: {
|
||||
react: 'window.React',
|
||||
'react-dom': 'window.ReactDOM',
|
||||
codemirror: 'window.CodeMirror',
|
||||
darkreader: 'window.DarkReader',
|
||||
},
|
||||
scripts: [
|
||||
'https://gw.alipayobjects.com/os/lib/react/16.13.1/umd/react.production.min.js',
|
||||
'https://gw.alipayobjects.com/os/lib/react-dom/16.13.1/umd/react-dom.production.min.js',
|
||||
'https://cdn.jsdelivr.net/npm/codemirror@5.60.0/lib/codemirror.min.js',
|
||||
'https://cdn.jsdelivr.net/npm/darkreader@4.9.27/darkreader.min.js',
|
||||
],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user