fix: cannot read properties of undefined (reading 'offsetWidthi')

This commit is contained in:
landaiqing
2024-04-27 01:17:51 +08:00
parent 21e475db41
commit ded7ef012a
7 changed files with 1160 additions and 52 deletions

View File

@@ -7,13 +7,19 @@ import * as path from 'path'
import imagemin from 'unplugin-imagemin/vite'
import viteCompression from 'vite-plugin-compression'
import { createHtmlPlugin } from 'vite-plugin-html'
import legacy from '@vitejs/plugin-legacy'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
//配置参数
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
return {
plugins: [
react(),
legacy({
targets: ['defaults', 'ie >= 11', 'chrome 52'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
}),
// 修改 icons 相关配置
createSvgIconsPlugin({
// 指定需要缓存的图标文件夹