Skip to content

Commit 767b1ba

Browse files
committed
fix(custom): 添加图标修复配置
1 parent aeeb194 commit 767b1ba

File tree

13 files changed

+535
-108
lines changed

13 files changed

+535
-108
lines changed

.env

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1-
# 生产环境
2-
# 请求地址
3-
VITE_APP_API_BASEURL = '/'
1+
# APP 名称
2+
VITE_APP_TITLE = 'uniAppTemplate'
3+
4+
# APP ID
5+
VITE_UNI_APPID = ''
6+
# 微信小程序 APP ID
7+
VITE_WX_APPID = 'wxb56964dd28204de0'
8+
9+
# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
10+
VITE_APP_PUBLIC_BASE = /
11+
12+
# h5是否需要配置代理
13+
VITE_APP_PROXY = false
14+
VITE_APP_PROXY_PREFIX = '/api'

.env.development

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
# 请求地址
44
# https://jsonplaceholder.typicode.com 免费模拟数据
55
VITE_APP_API_BASEURL = 'https://jsonplaceholder.typicode.com'
6+
7+
# storage前缀
8+
VITE_APP_PREFIX = 'storage'

.env.production

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 生产环境
2+
3+
# 请求地址
4+
# https://jsonplaceholder.typicode.com 免费模拟数据
5+
VITE_APP_API_BASEURL = 'https://jsonplaceholder.typicode.com'
6+
7+
# storage前缀
8+
VITE_APP_PREFIX = 'storage'

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# 工作流的名称,如果省略,则使用当前文件名
2+
name: Auto Deploy
3+
4+
# 从工作流生成的工作流运行的名称,如果省略,则使用提交时的commit信息
5+
run-name: Deploy by @${{ github.actor }}
6+
7+
# 触发部署的条件
8+
on:
9+
# 每当 push 到 master 分支时触发部署
10+
push:
11+
branches:
12+
- main
13+
14+
# 当前流程要执行的任务,可以是多个。[my_first_job]就是一个任务
15+
jobs:
16+
my_first_job:
17+
name: build-and-deploy
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Clone Code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
uses: pnpm/action-setup@v2
26+
with:
27+
version: 6.32.9
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: '20'
32+
cache: 'pnpm'
33+
- name: Cache dependencies
34+
uses: actions/cache@v4
35+
- name: Install dependencies
36+
run: pnpm install
37+
38+
- name: Run Build Script
39+
run: pnpm run build
40+
41+
- name: Deploy to GitHub Pages
42+
# 此actions的官方文档 https://github.com/JamesIves/github-pages-deploy-action
43+
uses: JamesIves/github-pages-deploy-action@v4
44+
with:
45+
# 要部署的文件夹,必填
46+
folder: dist/build/h5
47+
# 希望部署的分支,默认gh-pages
48+
branch: gh-pages
49+
# # 仓库范围的访问令牌,可以将个人令牌的值存储在GitHub Secrets中
50+
# # 默认情况是不需要填的,如果您需要更多权限,例如部署到另一个存储库才需要填写
51+
# # ACCESS_TOKEN 对应GitHub Secrets中设置的字段,不要照搬
52+
# TOKEN: ${{ secrets.ACCESS_TOKEN }}
53+
# # 部署到GitHub的不同仓库 <用户名>/<仓库名>
54+
# # 此选项必须配置了TOKEN才能正常执行
55+
# REPOSITORY-NAME: leoleor/leo2

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry = "http://registry.npmmirror.com"

manifest.config.js

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// manifest.config.ts
2+
import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest'
3+
import path from 'node:path'
4+
import { loadEnv } from 'vite'
5+
6+
// 获取环境变量的范例
7+
const env = loadEnv(process.env.NODE_ENV, path.resolve(process.cwd()))
8+
const { VITE_APP_TITLE, VITE_UNI_APPID, VITE_WX_APPID, VITE_APP_PUBLIC_BASE } = env
9+
10+
export default defineManifestConfig({
11+
name: VITE_APP_TITLE,
12+
appid: VITE_UNI_APPID,
13+
description: '',
14+
versionName: '1.0.0',
15+
versionCode: '100',
16+
transformPx: false,
17+
locale: 'zh-Hans',
18+
h5: {
19+
router: {
20+
base: VITE_APP_PUBLIC_BASE
21+
}
22+
},
23+
/* 5+App特有相关 */
24+
'app-plus': {
25+
usingComponents: true,
26+
nvueStyleCompiler: 'uni-app',
27+
compilerVersion: 3,
28+
compatible: {
29+
ignoreVersion: true
30+
},
31+
splashscreen: {
32+
alwaysShowBeforeRender: true,
33+
waiting: true,
34+
autoclose: true,
35+
delay: 0
36+
},
37+
/* 模块配置 */
38+
modules: {},
39+
/* 应用发布信息 */
40+
distribute: {
41+
/* android打包配置 */
42+
android: {
43+
minSdkVersion: 30,
44+
targetSdkVersion: 30,
45+
abiFilters: ['armeabi-v7a', 'arm64-v8a'],
46+
permissions: [
47+
'<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>',
48+
'<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>',
49+
'<uses-permission android:name="android.permission.VIBRATE"/>',
50+
'<uses-permission android:name="android.permission.READ_LOGS"/>',
51+
'<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>',
52+
'<uses-feature android:name="android.hardware.camera.autofocus"/>',
53+
'<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>',
54+
'<uses-permission android:name="android.permission.CAMERA"/>',
55+
'<uses-permission android:name="android.permission.GET_ACCOUNTS"/>',
56+
'<uses-permission android:name="android.permission.READ_PHONE_STATE"/>',
57+
'<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>',
58+
'<uses-permission android:name="android.permission.WAKE_LOCK"/>',
59+
'<uses-permission android:name="android.permission.FLASHLIGHT"/>',
60+
'<uses-feature android:name="android.hardware.camera"/>',
61+
'<uses-permission android:name="android.permission.WRITE_SETTINGS"/>'
62+
]
63+
},
64+
/* ios打包配置 */
65+
ios: {},
66+
/* SDK配置 */
67+
sdkConfigs: {}
68+
}
69+
},
70+
/* 快应用特有相关 */
71+
quickapp: {},
72+
/* 小程序特有相关 */
73+
'mp-weixin': {
74+
appid: VITE_WX_APPID,
75+
setting: {
76+
urlCheck: false
77+
},
78+
usingComponents: true
79+
// __usePrivacyCheck__: true,
80+
},
81+
'mp-alipay': {
82+
usingComponents: true,
83+
styleIsolation: 'shared'
84+
},
85+
'mp-baidu': {
86+
usingComponents: true
87+
},
88+
'mp-toutiao': {
89+
usingComponents: true
90+
},
91+
uniStatistics: {
92+
enable: false
93+
},
94+
vueVersion: '3'
95+
})

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
"@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
7878
"@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
7979
"@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
80+
"@iconify-json/ep": "^1.1.15",
81+
"@uni-helper/vite-plugin-uni-manifest": "^0.2.6",
8082
"@unocss/preset-legacy-compat": "^0.59.4",
8183
"@unocss/preset-uno": "^0.59.4",
8284
"@vue/runtime-core": "^3.2.45",

0 commit comments

Comments
 (0)