From f0cc569885eb82f74c3ad3566541410bc65c5d29 Mon Sep 17 00:00:00 2001 From: chenkaijie666 <1@qq.com> Date: Wed, 13 Aug 2025 16:26:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=AE=8C=E6=88=90=E6=9C=80=E7=BB=88uniapp?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/uniapp/manifest.json | 2 +- frontend/uniapp/package.json | 14 +++++++++++++- frontend/uniapp/vite.config.js | 23 +++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 frontend/uniapp/vite.config.js diff --git a/frontend/uniapp/manifest.json b/frontend/uniapp/manifest.json index fbc39f1..0df324d 100644 --- a/frontend/uniapp/manifest.json +++ b/frontend/uniapp/manifest.json @@ -1,6 +1,6 @@ { "name" : "uniapp", - "appid" : "", + "appid" : "__UNI__AFDE007", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", diff --git a/frontend/uniapp/package.json b/frontend/uniapp/package.json index 6abe37f..a3aaa31 100644 --- a/frontend/uniapp/package.json +++ b/frontend/uniapp/package.json @@ -4,13 +4,25 @@ "description": "", "main": "main.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "dev:h5": "vite --mode h5", + "dev:mp-weixin": "vite --mode mp-weixin", + "dev:app": "vite --mode app", + "build:h5": "vite build --mode h5", + "build:mp-weixin": "vite build --mode mp-weixin", + "build:app": "vite build --mode app", + "preview": "vite preview" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { + "@dcloudio/uni-cli-shared": "^2.0.2-4070520250711001", "@vant/weapp": "^1.11.7", "pinia": "^3.0.3" + }, + "devDependencies": { + "@dcloudio/vite-plugin-uni": "^3.0.0-alpha-4070520250711001", + "vite": "^5.0.0" } } diff --git a/frontend/uniapp/vite.config.js b/frontend/uniapp/vite.config.js new file mode 100644 index 0000000..6b36778 --- /dev/null +++ b/frontend/uniapp/vite.config.js @@ -0,0 +1,23 @@ +import { defineConfig } from 'vite' +import uni from '@dcloudio/vite-plugin-uni' + +export default defineConfig({ + plugins: [uni()], + server: { + port: 3000, + host: '0.0.0.0' + }, + build: { + outDir: 'unpackage/dist/build/h5', + assetsDir: 'static', + sourcemap: false, + minify: 'terser', + rollupOptions: { + output: { + manualChunks: { + vendor: ['vue', 'pinia'] + } + } + } + } +}) -- Gitee