mirror of
https://gitee.com/yiming_chang/vue-pure-admin.git
synced 2024-11-29 17:57:37 +08:00
feat: 打包后的文件提供传统浏览器兼容性支持
This commit is contained in:
parent
39159d5e7b
commit
eb0771e7ec
@ -6,3 +6,6 @@ VITE_ROUTER_HISTORY = "hash"
|
||||
|
||||
# 线上环境后端地址
|
||||
VITE_PROXY_DOMAIN_REAL = ""
|
||||
|
||||
# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
|
||||
VITE_LEGACY = false
|
@ -6,7 +6,8 @@ const warpperEnv = (envConf: Recordable): ViteEnv => {
|
||||
VITE_PUBLIC_PATH: "",
|
||||
VITE_PROXY_DOMAIN: "",
|
||||
VITE_PROXY_DOMAIN_REAL: "",
|
||||
VITE_ROUTER_HISTORY: ""
|
||||
VITE_ROUTER_HISTORY: "",
|
||||
VITE_LEGACY: false
|
||||
};
|
||||
|
||||
for (const envName of Object.keys(envConf)) {
|
||||
|
@ -85,6 +85,7 @@
|
||||
"@types/qs": "^6.9.7",
|
||||
"@typescript-eslint/eslint-plugin": "4.31.0",
|
||||
"@typescript-eslint/parser": "4.31.0",
|
||||
"@vitejs/plugin-legacy": "^1.6.4",
|
||||
"@vitejs/plugin-vue": "^1.10.2",
|
||||
"@vitejs/plugin-vue-jsx": "^1.3.1",
|
||||
"@vue/compiler-sfc": "^3.2.24",
|
||||
|
4714
pnpm-lock.yaml
4714
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
1
types/global.d.ts
vendored
1
types/global.d.ts
vendored
@ -69,6 +69,7 @@ declare global {
|
||||
VITE_PROXY_DOMAIN: string;
|
||||
VITE_PROXY_DOMAIN_REAL: string;
|
||||
VITE_ROUTER_HISTORY: string;
|
||||
VITE_LEGACY: boolean;
|
||||
}
|
||||
|
||||
declare interface ServerConfigs {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { resolve } from "path";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import svgLoader from "vite-svg-loader";
|
||||
import legacy from "@vitejs/plugin-legacy";
|
||||
import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||
import { warpperEnv, regExps } from "./build";
|
||||
import { viteMockServe } from "vite-plugin-mock";
|
||||
@ -28,6 +29,7 @@ const alias: Record<string, string> = {
|
||||
export default ({ command, mode }: ConfigEnv): UserConfigExport => {
|
||||
const {
|
||||
VITE_PORT,
|
||||
VITE_LEGACY,
|
||||
VITE_PUBLIC_PATH,
|
||||
VITE_PROXY_DOMAIN,
|
||||
VITE_PROXY_DOMAIN_REAL
|
||||
@ -162,7 +164,14 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
|
||||
setupProdMockServer();
|
||||
`,
|
||||
logger: true
|
||||
}),
|
||||
// 是否为打包后的文件提供传统浏览器兼容性支持
|
||||
VITE_LEGACY
|
||||
? legacy({
|
||||
targets: ["ie >= 11"],
|
||||
additionalLegacyPolyfills: ["regenerator-runtime/runtime"]
|
||||
})
|
||||
: null
|
||||
],
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
|
Loading…
Reference in New Issue
Block a user