build(cli): 迁移到 uni-app 官方 Vite CLI 骨架(src/ 布局)

按地图口径把 HBuilderX 工程改成官方 #vite(JS 版)CLI 工程:

- 业务代码 git mv 进 src/(176 个 rename,逐文件字节比对零内容改动):
  App.vue / main.js / manifest.json / pages.json / uni.scss /
  pages/ / packageMine/ / components/ / utils/ / static/ /
  uni_modules/ / uni.promisify.adaptor.js
- 新增官方骨架:package.json(@dcloudio/* 同版本 pin
  3.0.0-5020620260917001,vite 精确 5.2.8,vue ^3.4.21;只留 h5 与
  mp-weixin 脚本)、vite.config.js、shims-uni.d.ts;补 sass devDependency
  以支持既有 lang="scss"
- index.html 沿用本仓文件,入口改为 /src/main.js
- manifest.json 删除 app-plus / quickapp / mp-alipay / mp-baidu /
  mp-toutiao 五个死平台段,只留 mp-weixin
- .gitignore 加 dist/
- pnpm-workspace.yaml 新增 allowBuilds 白名单:pnpm 12 起
  onlyBuiltDependencies 已被移除,且 strictDepBuilds 默认 true 会把
  「未复核构建脚本」判成非零退出。白名单只列传递依赖
  esbuild / @parcel/watcher / core-js / core-js-pure。
  未使用 shamefully-hoist 或 node-linker=hoisted。

验收:pnpm build:mp-weixin 退出码 0,产物 app.json 的
pages / subPackages / tabBar / window 与改造前基线逐项一致;
project.config.json 落产物且 appid = wxf7ee9cd5801bf7a6。
This commit is contained in:
ticket-02 agent
2026-10-15 15:14:11 +08:00
parent 3a0c099704
commit 81a093120c
184 changed files with 5524 additions and 73 deletions
+1
View File
@@ -1,4 +1,5 @@
node_modules/
dist/
unpackage/
.hbuilderx/
.DS_Store
+1 -1
View File
@@ -15,6 +15,6 @@
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
<script type="module" src="/src/main.js"></script>
</body>
</html>
-72
View File
@@ -1,72 +0,0 @@
{
"name" : "tuanwei",
"appid" : "__UNI__F254BAB",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* 模块配置 */
"modules" : {},
/* 应用发布信息 */
"distribute" : {
/* android打包配置 */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios打包配置 */
"ios" : {},
/* SDK配置 */
"sdkConfigs" : {}
}
},
/* 快应用特有相关 */
"quickapp" : {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "wxf7ee9cd5801bf7a6",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "3"
}
+25
View File
@@ -0,0 +1,25 @@
{
"name": "tuanwei-uniapp",
"version": "1.0.0",
"scripts": {
"dev:h5": "uni",
"build:h5": "uni build",
"dev:mp-weixin": "uni -p mp-weixin",
"build:mp-weixin": "uni build -p mp-weixin"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-5020620260917001",
"@dcloudio/uni-components": "3.0.0-5020620260917001",
"@dcloudio/uni-h5": "3.0.0-5020620260917001",
"@dcloudio/uni-mp-weixin": "3.0.0-5020620260917001",
"vue": "^3.4.21"
},
"devDependencies": {
"@dcloudio/types": "3.4.31",
"@dcloudio/vite-plugin-uni": "3.0.0-5020620260917001",
"@vue/runtime-core": "^3.4.21",
"rollup": "4.14.3",
"sass": "^1.77.8",
"vite": "5.2.8"
}
}
+5449
View File
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
# pnpm 12 起,依赖的构建脚本默认「不予执行」,且 strictDepBuilds 默认为 true,
# 会把安装判成非零退出(ERR_PNPM_IGNORED_BUILDS)。这里显式复核这 4 个包。
# 说明(均为 uni-app 官方依赖树的传递依赖):
# esbuild —— vite 的打包器,postinstall 校验平台二进制
# @parcel/watcher—— 原生文件监听(dev watch 用)
# core-js / core-js-pure —— 仅打印赞助信息,无构建产物
allowBuilds:
esbuild: true
'@parcel/watcher': true
core-js: true
core-js-pure: true
+10
View File
@@ -0,0 +1,10 @@
/// <reference types='@dcloudio/types' />
import 'vue'
declare module '@vue/runtime-core' {
type Hooks = App.AppInstance & Page.PageInstance;
interface ComponentCustomOptions extends Hooks {
}
}
View File
View File
+19
View File
@@ -0,0 +1,19 @@
{
"name" : "tuanwei",
"appid" : "__UNI__F254BAB",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"mp-weixin" : {
"appid" : "wxf7ee9cd5801bf7a6",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "3"
}
View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Before

Width:  |  Height:  |  Size: 354 KiB

After

Width:  |  Height:  |  Size: 354 KiB

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

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