Skip to content

Commit 666ba49

Browse files
committed
feat(template): 添加unh
1 parent 12d0ff4 commit 666ba49

File tree

6 files changed

+3938
-9576
lines changed

6 files changed

+3938
-9576
lines changed

packages/core/template/base/package.json

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,9 @@
44
"version": "0.1.0",
55
"private": true,
66
"scripts": {
7-
"dev": "uni",
8-
"dev:app": "uni -p app",
9-
"dev:app-android": "uni -p app-android",
10-
"dev:app-ios": "uni -p app-ios",
11-
"dev:custom": "uni -p",
12-
"dev:h5": "uni",
13-
"dev:h5:ssr": "uni --ssr",
14-
"dev:mp-alipay": "uni -p mp-alipay",
15-
"dev:mp-baidu": "uni -p mp-baidu",
16-
"dev:mp-jd": "uni -p mp-jd",
17-
"dev:mp-kuaishou": "uni -p mp-kuaishou",
18-
"dev:mp-lark": "uni -p mp-lark",
19-
"dev:mp-qq": "uni -p mp-qq",
20-
"dev:mp-toutiao": "uni -p mp-toutiao",
21-
"dev:mp-weixin": "uni -p mp-weixin",
22-
"dev:quickapp-webview": "uni -p quickapp-webview",
23-
"dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",
24-
"dev:quickapp-webview-union": "uni -p quickapp-webview-union",
25-
"build": "uni build",
26-
"build:app": "uni build -p app",
27-
"build:app-android": "uni build -p app-android",
28-
"build:app-ios": "uni build -p app-ios",
29-
"build:custom": "uni build -p",
30-
"build:h5": "uni build",
31-
"build:h5:ssr": "uni build --ssr",
32-
"build:mp-alipay": "uni build -p mp-alipay",
33-
"build:mp-baidu": "uni build -p mp-baidu",
34-
"build:mp-jd": "uni build -p mp-jd",
35-
"build:mp-kuaishou": "uni build -p mp-kuaishou",
36-
"build:mp-lark": "uni build -p mp-lark",
37-
"build:mp-qq": "uni build -p mp-qq",
38-
"build:mp-toutiao": "uni build -p mp-toutiao",
39-
"build:mp-weixin": "uni build -p mp-weixin",
40-
"build:quickapp-webview": "uni build -p quickapp-webview",
41-
"build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",
42-
"build:quickapp-webview-union": "uni build -p quickapp-webview-union"
7+
"dev": "unh dev",
8+
"build": "unh build",
9+
"about": "unh info"
4310
},
4411
"dependencies": {
4512
"@dcloudio/uni-app": "3.0.0-4070620250821001",
@@ -69,6 +36,7 @@
6936
"@dcloudio/vite-plugin-uni": "3.0.0-4070620250821001",
7037
"@mini-types/alipay": "^3.0.14",
7138
"@uni-helper/plugin-uni": "0.1.0",
39+
"@uni-helper/unh": "0.2.1",
7240
"@uni-helper/uni-types": "^1.0.0-alpha.6",
7341
"@vue/runtime-core": "3.4.21",
7442
"miniprogram-api-typings": "^4.1.0",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function getData() {
2+
return {
3+
autoGenerate: {
4+
pages: false,
5+
manifest: false,
6+
},
7+
}
8+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { defineConfig } from '@uni-helper/unh'
2+
3+
/**
4+
* unh 配置文件
5+
* 更多配置请参考:https://uni-helper.js.org/unh/
6+
*/
7+
export default defineConfig({
8+
platform: {
9+
// 默认平台
10+
default: 'h5',
11+
// 平台别名
12+
alias: {
13+
'h5': ['w', 'h'],
14+
'mp-weixin': 'wx',
15+
},
16+
},
17+
<%_ if (autoGenerate.pages || autoGenerate.manifest) { _%>
18+
autoGenerate: {
19+
<%_ if (autoGenerate.pages) { _%>
20+
pages: <%= autoGenerate.pages %>,
21+
<%_ } _%>
22+
<%_ if (autoGenerate.manifest) { _%>
23+
manifest: <%= autoGenerate.manifest %>,
24+
<%_ } _%>
25+
},
26+
<%_ } _%>
27+
})
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function getData({ oldData }) {
2+
return {
3+
autoGenerate: {
4+
...oldData.autoGenerate,
5+
manifest: true,
6+
},
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function getData({ oldData }) {
2+
return {
3+
autoGenerate: {
4+
...oldData.autoGenerate,
5+
pages: true,
6+
},
7+
}
8+
}

0 commit comments

Comments
 (0)