Browse Source

chore: 删除 `@vitejs/plugin-legacy`,`vue3` 无法通过任何工具使其支持`ie`

xiaoxian521 2 years ago
parent
commit
2235d9d7a8
11 changed files with 178 additions and 232 deletions
  1. 0 3
      .env.production
  2. 0 3
      .env.staging
  3. 0 1
      CHANGELOG.en_US.md
  4. 0 1
      CHANGELOG.md
  5. 0 1
      CHANGELOG.zh_CN.md
  6. 0 1
      build/index.ts
  7. 0 9
      build/plugins.ts
  8. 5 6
      package.json
  9. 170 198
      pnpm-lock.yaml
  10. 0 1
      types/global.d.ts
  11. 3 8
      vite.config.ts

+ 0 - 3
.env.production

@@ -4,9 +4,6 @@ VITE_PUBLIC_PATH = /
 # 线上环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数")
 VITE_ROUTER_HISTORY = "hash"
 
-# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
-VITE_LEGACY = false
-
 # 是否在打包时使用cdn替换本地库 替换 true 不替换 false
 VITE_CDN = false
 

+ 0 - 3
.env.staging

@@ -7,9 +7,6 @@ VITE_PUBLIC_PATH = /
 # 预发布环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数")
 VITE_ROUTER_HISTORY = "hash"
 
-# 是否为打包后的文件提供传统浏览器兼容性支持 支持 true 不支持 false
-VITE_LEGACY = false
-
 # 是否在打包时使用cdn替换本地库 替换 true 不替换 false
 VITE_CDN = true
 

+ 0 - 1
CHANGELOG.en_US.md

@@ -282,7 +282,6 @@
 - Optimize the tab page to bring a better interactive experience
 - Routing title supports direct writing in Chinese, which can be separated from internationalization
 - Route history mode is read from env and supports base parameter
-- Packaged files provide traditional browser compatibility support, configure VITE_LEGACY to true
 
 # 2.6.0(2021-11-10)
 

+ 0 - 1
CHANGELOG.md

@@ -282,7 +282,6 @@
 - Optimize the tab page to bring a better interactive experience
 - Routing title supports direct writing in Chinese, which can be separated from internationalization
 - Route history mode is read from env and supports base parameter
-- Packaged files provide traditional browser compatibility support, configure VITE_LEGACY to true
 
 # 2.6.0(2021-11-10)
 

+ 0 - 1
CHANGELOG.zh_CN.md

@@ -282,7 +282,6 @@
 - 优化标签页,带来更好的交互体验
 - 路由 title 支持直接写中文,可脱离国际化
 - 路由历史模式从 env 读取并支持 base 参数
-- 打包后的文件提供传统浏览器兼容性支持,配置 VITE_LEGACY 为 true
 
 # 2.6.0(2021-11-10)
 

+ 0 - 1
build/index.ts

@@ -5,7 +5,6 @@ const warpperEnv = (envConf: Recordable): ViteEnv => {
     VITE_PORT: 8848,
     VITE_PUBLIC_PATH: "",
     VITE_ROUTER_HISTORY: "",
-    VITE_LEGACY: false,
     VITE_CDN: false,
     VITE_COMPRESSION: "none"
   };

+ 0 - 9
build/plugins.ts

@@ -3,7 +3,6 @@ import { resolve } from "path";
 import vue from "@vitejs/plugin-vue";
 import { viteBuildInfo } from "./info";
 import svgLoader from "vite-svg-loader";
-import legacy from "@vitejs/plugin-legacy";
 import vueJsx from "@vitejs/plugin-vue-jsx";
 import VueMacros from "unplugin-vue-macros/vite";
 import { viteMockServe } from "vite-plugin-mock";
@@ -16,7 +15,6 @@ import { genScssMultipleScopeVars } from "../src/layout/theme";
 
 export function getPluginsList(
   command: string,
-  VITE_LEGACY: boolean,
   VITE_CDN: boolean,
   VITE_COMPRESSION: ViteCompression
 ) {
@@ -65,13 +63,6 @@ export function getPluginsList(
         `,
       logger: false
     }),
-    // 是否为打包后的文件提供传统浏览器兼容性支持
-    VITE_LEGACY
-      ? legacy({
-          targets: ["ie >= 11"],
-          additionalLegacyPolyfills: ["regenerator-runtime/runtime"]
-        })
-      : null,
     // 打包分析
     lifecycle === "report"
       ? visualizer({ open: true, brotliSize: true, filename: "report.html" })

+ 5 - 6
package.json

@@ -107,9 +107,8 @@
     "@types/qrcode": "^1.4.2",
     "@types/qs": "^6.9.7",
     "@types/sortablejs": "^1.13.0",
-    "@typescript-eslint/eslint-plugin": "^5.42.1",
-    "@typescript-eslint/parser": "^5.42.1",
-    "@vitejs/plugin-legacy": "^2.3.1",
+    "@typescript-eslint/eslint-plugin": "^5.43.0",
+    "@typescript-eslint/parser": "^5.43.0",
     "@vitejs/plugin-vue": "^3.2.0",
     "@vitejs/plugin-vue-jsx": "^2.1.1",
     "@vue/eslint-config-prettier": "^7.0.0",
@@ -141,10 +140,10 @@
     "stylelint-config-recommended": "^9.0.0",
     "stylelint-config-standard": "^29.0.0",
     "stylelint-order": "^5.0.0",
-    "tailwindcss": "^3.2.2",
+    "tailwindcss": "^3.2.4",
     "terser": "^5.15.1",
-    "typescript": "^4.8.4",
-    "unplugin-vue-macros": "^0.16.2",
+    "typescript": "^4.9.3",
+    "unplugin-vue-macros": "^0.16.3",
     "vite": "3.1.8",
     "vite-plugin-cdn-import": "^0.3.5",
     "vite-plugin-compression": "^0.5.1",

File diff suppressed because it is too large
+ 170 - 198
pnpm-lock.yaml


+ 0 - 1
types/global.d.ts

@@ -87,7 +87,6 @@ declare global {
     VITE_PORT: number;
     VITE_PUBLIC_PATH: string;
     VITE_ROUTER_HISTORY: string;
-    VITE_LEGACY: boolean;
     VITE_CDN: boolean;
     VITE_COMPRESSION: ViteCompression;
   }

+ 3 - 8
vite.config.ts

@@ -26,13 +26,8 @@ const __APP_INFO__ = {
 };
 
 export default ({ command, mode }: ConfigEnv): UserConfigExport => {
-  const {
-    VITE_CDN,
-    VITE_PORT,
-    VITE_LEGACY,
-    VITE_COMPRESSION,
-    VITE_PUBLIC_PATH
-  } = warpperEnv(loadEnv(mode, root));
+  const { VITE_CDN, VITE_PORT, VITE_COMPRESSION, VITE_PUBLIC_PATH } =
+    warpperEnv(loadEnv(mode, root));
   return {
     base: VITE_PUBLIC_PATH,
     root,
@@ -49,7 +44,7 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
       // 本地跨域代理 https://cn.vitejs.dev/config/server-options.html#server-proxy
       proxy: {}
     },
-    plugins: getPluginsList(command, VITE_LEGACY, VITE_CDN, VITE_COMPRESSION),
+    plugins: getPluginsList(command, VITE_CDN, VITE_COMPRESSION),
     optimizeDeps: {
       include: ["pinia", "vue-i18n", "lodash-es", "@vueuse/core", "dayjs"],
       exclude: ["@pureadmin/theme/dist/browser-utils"]

Some files were not shown because too many files changed in this diff