Skip to content

Commit

Permalink
release: update 3.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Nov 30, 2022
1 parent 54972f0 commit 8a09873
Show file tree
Hide file tree
Showing 80 changed files with 1,552 additions and 1,180 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# 项目本地运行端口号
# 平台本地运行端口号
VITE_PORT = 8848
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 项目本地运行端口号
# 平台本地运行端口号
VITE_PORT = 8848

# 开发环境读取配置文件路径
VITE_PUBLIC_PATH = /

# 开发环境路由历史模式
# 开发环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数")
VITE_ROUTER_HISTORY = "hash"
7 changes: 2 additions & 5 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# 线上环境项目打包路径
# 线上环境平台打包路径
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

Expand Down
5 changes: 1 addition & 4 deletions .env.staging
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ NODE_ENV=production

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

Expand Down
5 changes: 2 additions & 3 deletions build/index.ts
Original file line number Diff line number Diff line change
@@ -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"
};
Expand All @@ -28,7 +27,7 @@ const warpperEnv = (envConf: Recordable): ViteEnv => {
return ret;
};

/** 环境变量 */
/** 获取环境变量 */
const loadEnv = (): ViteEnv => {
return import.meta.env;
};
Expand Down
37 changes: 37 additions & 0 deletions build/optimize.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* 此文件作用于 `vite.config.ts` 的 `optimizeDeps.include` 依赖预构建配置项
* 依赖预构建,`vite` 启动时会将下面 include 里的模块,编译成 esm 格式并缓存到 node_modules/.vite 文件夹,页面加载到对应模块时如果浏览器有缓存就读取浏览器缓存,如果没有会读取本地缓存并按需加载
* 尤其当您禁用浏览器缓存时(这种情况只应该发生在调试阶段)必须将对应模块加入到 include里,否则会遇到开发环境切换页面卡顿的问题(vite 会认为它是一个新的依赖包会重新加载并强制刷新页面),因为它既无法使用浏览器缓存,又没有在本地 node_modules/.vite 里缓存
* 温馨提示:如果您使用的第三方库是全局引入,也就是引入到 src/main.ts 文件里,就不需要再添加到 include 里了,因为 vite 会自动将它们缓存到 node_modules/.vite
*/
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"
];

/**
* 在预构建中强制排除的依赖项
* 温馨提示:所有以 `@iconify-icons/` 开头引入的的本地图标模块,都应该加入到下面的 `exclude` 里,因为平台推荐的使用方式是哪里需要哪里引入而且都是单个的引入,不需要预构建,直接让浏览器加载就好
*/
const exclude = [
"@iconify-icons/ep",
"@iconify-icons/ri",
"@pureadmin/theme/dist/browser-utils"
];

export { include, exclude };
13 changes: 2 additions & 11 deletions build/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ 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 { electronPlugin } from "./electron";
import VueMacros from "unplugin-vue-macros/vite";
import { viteMockServe } from "vite-plugin-mock";
import { configCompressPlugin } from "./compress";
// import ElementPlus from "unplugin-element-plus/vite";
import { visualizer } from "rollup-plugin-visualizer";
import removeConsole from "vite-plugin-remove-console";
import themePreprocessorPlugin from "@pureadmin/theme";
import DefineOptions from "unplugin-vue-define-options/vite";
import { genScssMultipleScopeVars } from "../src/layout/theme";

export function getPluginsList(
command: string,
VITE_LEGACY: boolean,
VITE_CDN: boolean,
VITE_COMPRESSION: ViteCompression
) {
Expand All @@ -28,7 +26,7 @@ export function getPluginsList(
vueJsx(),
VITE_CDN ? cdn : null,
configCompressPlugin(VITE_COMPRESSION),
VueMacros(),
DefineOptions(),
// 线上环境删除console
removeConsole({ external: ["src/assets/iconfont/iconfont.js"] }),
viteBuildInfo(),
Expand Down Expand Up @@ -60,13 +58,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" })
Expand Down
4 changes: 0 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
<meta
http-equiv="Content-Security-Policy"
content="script-src 'self' 'unsafe-inline';"
/>
<title>pure-admin-thin</title>
<link rel="icon" href="/favicon.ico" />
<script>
Expand Down
4 changes: 3 additions & 1 deletion mock/asyncRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 模拟后端动态生成路由
import { MockMethod } from "vite-plugin-mock";

import Lollipop from "@iconify-icons/ep/lollipop";

/**
* roles:页面级别权限,这里模拟二种 "admin"、"common"
* admin:管理员角色
Expand All @@ -11,7 +13,7 @@ const permissionRouter = {
path: "/permission",
meta: {
title: "权限管理",
icon: "lollipop",
icon: Lollipop,
rank: 10
},
children: [
Expand Down
39 changes: 18 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pure-admin-thin",
"version": "3.6.4",
"version": "3.9.0",
"private": true,
"main": "dist-electron/main/index.js",
"scripts": {
Expand Down Expand Up @@ -29,18 +29,16 @@
],
"dependencies": {
"@ctrl/tinycolor": "^3.4.1",
"@pureadmin/components": "^1.1.0",
"@pureadmin/descriptions": "^1.1.0",
"@pureadmin/table": "^1.2.0",
"@pureadmin/utils": "^1.1.5",
"@vueuse/core": "^9.4.0",
"@vueuse/motion": "^2.0.0-beta.12",
"@vueuse/shared": "^9.4.0",
"@pureadmin/table": "^1.8.0",
"@pureadmin/utils": "^1.6.7",
"@vueuse/core": "^9.6.0",
"@vueuse/motion": "2.0.0-beta.12",
"animate.css": "^4.1.1",
"axios": "^1.1.3",
"dayjs": "^1.11.4",
"echarts": "^5.3.3",
"element-plus": "^2.2.20",
"axios": "^1.2.0",
"dayjs": "^1.11.6",
"echarts": "^5.4.0",
"element-plus": "^2.2.25",
"element-resize-detector": "^1.2.4",
"js-cookie": "^3.0.1",
"lodash": "^4.17.21",
Expand All @@ -50,15 +48,14 @@
"mockjs": "^1.1.0",
"nprogress": "^0.2.0",
"path": "^0.12.7",
"pinia": "^2.0.21",
"pinia": "^2.0.26",
"qs": "^6.11.0",
"resize-observer-polyfill": "^1.5.1",
"responsive-storage": "^2.1.0",
"vue": "^3.2.44",
"vue": "^3.2.45",
"vue-router": "^4.1.6",
"vue-types": "^4.2.1",
"vxe-table": "^4.3.2",
"xe-utils": "^3.5.6"
"vxe-table": "^4.3.6",
"xe-utils": "^3.5.7"
},
"devDependencies": {
"@commitlint/cli": "13.1.0",
Expand All @@ -82,7 +79,6 @@
"@vitejs/plugin-vue-jsx": "^2.1.1",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.2",
"@vue/runtime-core": "^3.2.44",
"autoprefixer": "^10.4.13",
"cloc": "^2.10.0",
"cross-env": "^7.0.3",
Expand Down Expand Up @@ -112,17 +108,18 @@
"stylelint-config-recommended": "^9.0.0",
"stylelint-config-standard": "^29.0.0",
"stylelint-order": "^5.0.0",
"tailwindcss": "^3.2.3",
"svgo": "^3.0.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-define-options": "^1.0.0",
"vite": "3.1.8",
"vite-electron-plugin": "^0.5.1",
"vite-plugin-cdn-import": "^0.3.5",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-electron-renderer": "^0.10.3",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-remove-console": "^1.2.0",
"vite-plugin-remove-console": "^1.3.0",
"vite-svg-loader": "^3.6.0",
"vue-eslint-parser": "^9.1.0",
"vue-tsc": "^1.0.9"
Expand Down
5 changes: 3 additions & 2 deletions public/serverConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Version": "3.6.4",
"Version": "3.9.0",
"Title": "PureAdmin",
"FixedHeader": true,
"HiddenSideBar": false,
Expand All @@ -14,5 +14,6 @@
"SidebarStatus": true,
"EpThemeColor": "#409EFF",
"ShowLogo": true,
"ShowModel": "smart"
"ShowModel": "smart",
"MenuArrowIconNoTransition": true
}
2 changes: 1 addition & 1 deletion src/assets/login/avatar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/login/illustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8a09873

Please sign in to comment.