feat:uniapp模块

This commit is contained in:
一休哥哥6666
2026-07-14 14:53:45 +08:00
parent 324679964c
commit 721543f423
52 changed files with 16706 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
/**
* CLI 构建 app manifest 中 splashscreen.autoclose 恒为 false打包后补丁修正。
* HBuilderX 云打包会读取 dist/build/app 或 app-plus 下的 manifest.json。
*/
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const root = path.resolve(__dirname, '..')
const targets = [
path.join(root, 'dist/build/app/manifest.json'),
path.join(root, 'dist/build/app-plus/manifest.json')
]
for (const file of targets) {
if (!fs.existsSync(file)) continue
const manifest = JSON.parse(fs.readFileSync(file, 'utf8'))
if (manifest.plus) {
manifest.plus.splashscreen = {
...(manifest.plus.splashscreen || {}),
autoclose: true,
waiting: false,
delay: 0
}
manifest.plus.renderer = 'webview'
manifest.plus.compatible = { ignoreVersion: true }
manifest.plus.distribute = manifest.plus.distribute || {}
manifest.plus.distribute.google = {
...(manifest.plus.distribute.google || {}),
packagename: 'com.jyuan.optical'
}
if (manifest.plus['uni-app']) {
manifest.plus['uni-app'].renderer = 'webview'
}
}
fs.writeFileSync(file, JSON.stringify(manifest, null, 2), 'utf8')
console.log('[patch-app-manifest] patched', path.relative(root, file))
}