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:
+27
@@ -0,0 +1,27 @@
|
||||
import App from './App'
|
||||
import uvUI from '@/uni_modules/uv-ui-tools'
|
||||
|
||||
// #ifndef VUE3
|
||||
import Vue from 'vue'
|
||||
import './uni.promisify.adaptor'
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(uvUI)
|
||||
|
||||
App.mpType = 'app'
|
||||
const app = new Vue({
|
||||
...App
|
||||
})
|
||||
app.$mount()
|
||||
// #endif
|
||||
|
||||
// #ifdef VUE3
|
||||
import { createSSRApp } from 'vue'
|
||||
export function createApp() {
|
||||
const app = createSSRApp(App)
|
||||
app.use(uvUI)
|
||||
return {
|
||||
app
|
||||
}
|
||||
}
|
||||
// #endif
|
||||
Reference in New Issue
Block a user