Browse Source

去除vite压缩插件,会导致vercel和netlify无法打包

v1
zyronon 1 year ago
parent
commit
840ab94d63
  1. 78
      vite.config.js

78
vite.config.js

@ -61,45 +61,45 @@ export default defineConfig({
} }
], ],
}), }),
viteCompression({ // viteCompression({
verbose: false, // verbose: false,
disable: false, // disable: false,
threshold: 10240, // threshold: 10240,
algorithm: 'brotliCompress', // algorithm: 'brotliCompress',
}), // }),
viteCompression({ // viteCompression({
verbose: false, // verbose: false,
disable: false, // disable: false,
algorithm: 'gzip', // algorithm: 'gzip',
threshold: 10240, // threshold: 10240,
}), // }),
viteImagemin({ // viteImagemin({
gifsicle: { // gifsicle: {
optimizationLevel: 7, // optimizationLevel: 7,
interlaced: false, // interlaced: false,
}, // },
optipng: { // optipng: {
optimizationLevel: 7, // optimizationLevel: 7,
}, // },
mozjpeg: { // mozjpeg: {
quality: 20, // quality: 20,
}, // },
pngquant: { // pngquant: {
quality: [0.8, 0.9], // quality: [0.8, 0.9],
speed: 4, // speed: 4,
}, // },
svgo: { // svgo: {
plugins: [ // plugins: [
{ // {
name: 'removeViewBox', // name: 'removeViewBox',
}, // },
{ // {
name: 'removeEmptyAttrs', // name: 'removeEmptyAttrs',
active: false, // active: false,
}, // },
], // ],
}, // },
}), // }),
], ],
resolve: { resolve: {
alias: { alias: {

Loading…
Cancel
Save