From be96691325bc95575ec1d4ac00445d599fb61d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E4=B8=80=E9=A5=BC?= Date: Fri, 1 Nov 2024 12:23:41 +0800 Subject: [PATCH] feat: node polyfills --- awesome | 2 +- client/uniapp/package.json | 1 + client/uniapp/src/pages.json | 15 +++++++++++++++ client/uniapp/src/types/uni-pages.d.ts | 2 ++ client/uniapp/vite.config.ts | 3 ++- thirdparty/diamond | 2 +- thirdparty/utils | 2 +- 7 files changed, 23 insertions(+), 4 deletions(-) diff --git a/awesome b/awesome index 2535b06d..576709b6 160000 --- a/awesome +++ b/awesome @@ -1 +1 @@ -Subproject commit 2535b06d3f982ae2b91ab6d0efb57ff738417845 +Subproject commit 576709b6d1b52e78aa73cb6c3ae093fc65a97591 diff --git a/client/uniapp/package.json b/client/uniapp/package.json index f1ec1542..c29ffefd 100644 --- a/client/uniapp/package.json +++ b/client/uniapp/package.json @@ -150,6 +150,7 @@ "unocss-applet": "^0.8.2", "unplugin-auto-import": "^0.18.3", "vite": "5.2.8", + "vite-plugin-node-polyfills": "^0.22.0", "vite-plugin-restart": "^0.4.1", "vue-i18n": "9.1.9", "vue-tsc": "^2.1.6" diff --git a/client/uniapp/src/pages.json b/client/uniapp/src/pages.json index d9fac923..3790bfd1 100644 --- a/client/uniapp/src/pages.json +++ b/client/uniapp/src/pages.json @@ -81,6 +81,21 @@ "navigationBarTitleText": "瞬间" } }, + { + "path": "pages/user/active", + "type": "page", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "激活" + } + }, + { + "path": "pages/user/login", + "type": "page", + "style": { + "navigationBarTitleText": "登录" + } + }, { "path": "pages/wopan/list", "type": "page", diff --git a/client/uniapp/src/types/uni-pages.d.ts b/client/uniapp/src/types/uni-pages.d.ts index 6703beec..f1faf250 100644 --- a/client/uniapp/src/types/uni-pages.d.ts +++ b/client/uniapp/src/types/uni-pages.d.ts @@ -9,6 +9,8 @@ interface NavigateToOptions { "/pages/about/i18n" | "/pages/moment/moment_detail" | "/pages/moment/moment_list" | + "/pages/user/active" | + "/pages/user/login" | "/pages/wopan/list" | "/pages/wopan/login" | "/pages/wopan/view"; diff --git a/client/uniapp/vite.config.ts b/client/uniapp/vite.config.ts index 3a0c1206..bcc30185 100644 --- a/client/uniapp/vite.config.ts +++ b/client/uniapp/vite.config.ts @@ -16,7 +16,7 @@ import UnoCSS from 'unocss/vite' import AutoImport from 'unplugin-auto-import/vite' import { visualizer } from 'rollup-plugin-visualizer' import ViteRestart from 'vite-plugin-restart' - +import { nodePolyfills } from 'vite-plugin-node-polyfills' // https://vitejs.dev/config/ export default ({ command, mode }) => { // console.log(mode === process.env.NODE_ENV) // true @@ -49,6 +49,7 @@ export default ({ command, mode }) => { envDir, // 自定义env目录 // envPrefix: 'VITE_', // 由于第三方库已经使用了VITE_开头的环境变量,所以限制了不能自定义 plugins: [ + nodePolyfills(), UniPages({ exclude: ['**/components/**/**.*'], routeBlockLang: 'json5', // 虽然设了默认值,但是vue文件还是要加上 lang="json5", 这样才能很好地格式化 diff --git a/thirdparty/diamond b/thirdparty/diamond index 4e3ad18f..fbea3689 160000 --- a/thirdparty/diamond +++ b/thirdparty/diamond @@ -1 +1 @@ -Subproject commit 4e3ad18ff23cbece51d9b8f3b713bd11ad8ad950 +Subproject commit fbea36897de2cf198b3cac62ac770063cff1f3d4 diff --git a/thirdparty/utils b/thirdparty/utils index 4438851c..feae711d 160000 --- a/thirdparty/utils +++ b/thirdparty/utils @@ -1 +1 @@ -Subproject commit 4438851c63c209c985aedc4edc5c8e0586146cea +Subproject commit feae711df60868eb97dbd11cc7338c094b9748c2