release: update 3.8.0

This commit is contained in:
xiaoxian521
2022-11-26 19:14:08 +08:00
parent d53496e495
commit 6110be29a1
63 changed files with 1291 additions and 929 deletions

View File

@@ -1,11 +1,10 @@
/** 处理环境变量 */
const warpperEnv = (envConf: Recordable): ViteEnv => {
/** 此处为默认值,无需修改 */
/** 此处为默认值 */
const ret: ViteEnv = {
VITE_PORT: 8848,
VITE_PUBLIC_PATH: "",
VITE_ROUTER_HISTORY: "",
VITE_LEGACY: false,
VITE_CDN: false,
VITE_COMPRESSION: "none"
};
@@ -28,7 +27,7 @@ const warpperEnv = (envConf: Recordable): ViteEnv => {
return ret;
};
/** 环境变量 */
/** 获取环境变量 */
const loadEnv = (): ViteEnv => {
return import.meta.env;
};

25
build/optimize.ts Normal file
View File

@@ -0,0 +1,25 @@
/**
* 此文件作用于 `vite.config.ts` 的 `optimizeDeps.include` 依赖预构建配置项
* 依赖预构建,`vite` 启动时会将下面 include 里的模块,编译成 esm 格式并缓存到 node_modules/.vite 文件夹,页面加载到对应模块时如果浏览器有缓存就读取浏览器缓存,如果没有会读取本地缓存并按需加载
* 尤其当您禁用浏览器缓存时(这种情况只应该发生在调试阶段)必须将对应模块加入到 include里否则会遇到开发环境切换页面卡顿的问题vite 会认为它是一个新的依赖包会重新加载并强制刷新页面),因为它既无法使用浏览器缓存,又没有在本地 node_modules/.vite 里缓存
* 温馨提示:如果您使用的第三方库是全局引入,也就是引入到 src/main.ts 文件里,就不需要再添加到 include 里了,因为 vite 会自动将它们缓存到 node_modules/.vite
*/
export const include = [
"qs",
"mitt",
"dayjs",
"axios",
"pinia",
"lodash",
"echarts",
"xe-utils",
"vxe-table",
"js-cookie",
"lodash-es",
"@vueuse/core",
"lodash-unified",
"@ctrl/tinycolor",
"@pureadmin/utils",
"responsive-storage",
"element-resize-detector"
];

View File

@@ -2,7 +2,6 @@ import { cdn } from "./cdn";
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";
@@ -15,7 +14,6 @@ import { genScssMultipleScopeVars } from "../src/layout/theme";
export function getPluginsList(
command: string,
VITE_LEGACY: boolean,
VITE_CDN: boolean,
VITE_COMPRESSION: ViteCompression
) {
@@ -59,13 +57,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" })