图片压缩
打包时使用 image-webpack-loader
压缩图片
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| import { defineConfig } from 'umi';
export default defineConfig({ chainWebpack(memo, { env, webpack, createCSSRule }) { memo.module .rule('images') .use('image-webpack-loader') .loader(require.resolve('image-webpack-loader')) .options({ options: { bypassOnDebug: true, disable: true, }, }); }, });
|