fix(浏览器): 兼容低版本Chromium 内核浏览器,解决内核81版本页面白屏问题#1226

This commit is contained in:
dataeaseShu
2026-06-29 14:01:34 +08:00
committed by dataeaseShu
parent 582893ab65
commit 8ad3837083
4 changed files with 19 additions and 2 deletions
+3 -1
View File
@@ -24,6 +24,7 @@
"@npkg/tinymce-plugins": "^0.0.7",
"@tinymce/tinymce-vue": "^5.1.0",
"@vueuse/core": "^14.1.0",
"core-js": "^3.49.0",
"dayjs": "^1.11.13",
"element-plus": "^2.10.1",
"element-plus-secondary": "^1.0.0",
@@ -55,6 +56,7 @@
"@types/node": "^22.14.1",
"@typescript-eslint/eslint-plugin": "^8.34.0",
"@typescript-eslint/parser": "^8.34.0",
"@vitejs/plugin-legacy": "^6.1.1",
"@vitejs/plugin-vue": "^5.2.2",
"@vue/tsconfig": "^0.7.0",
"axios": "^1.8.4",
@@ -76,4 +78,4 @@
"vite-svg-loader": "^5.1.0",
"vue-tsc": "^2.2.8"
}
}
}
+2
View File
@@ -1,3 +1,5 @@
import 'core-js/features/object/has-own'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import './style.less'
+1 -1
View File
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2022",
"target": "ES2020",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,
+13
View File
@@ -5,6 +5,8 @@ import Components from 'unplugin-vue-components-secondary/vite'
import { ElementPlusResolver } from 'unplugin-vue-components-secondary/resolvers'
import path from 'path'
import svgLoader from 'vite-svg-loader'
import legacy from '@vitejs/plugin-legacy'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
console.info(mode)
@@ -26,6 +28,11 @@ export default defineConfig(({ mode }) => {
svgo: false,
defaultImport: 'component', // or 'raw'
}),
legacy({
targets: ['Chrome >= 81'],
polyfills: true,
modernPolyfills: true,
}),
],
resolve: {
alias: {
@@ -40,6 +47,7 @@ export default defineConfig(({ mode }) => {
},
},
build: {
target: 'chrome81',
chunkSizeWarningLimit: 2000,
rollupOptions: {
output: {
@@ -49,6 +57,11 @@ export default defineConfig(({ mode }) => {
},
},
},
optimizeDeps: {
esbuildOptions: {
target: 'chrome81',
},
},
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment',