Skip to content

Commit

Permalink
fix(custom): 添加图标修复配置
Browse files Browse the repository at this point in the history
  • Loading branch information
gitboyzcf committed Jul 12, 2024
1 parent aeeb194 commit 767b1ba
Show file tree
Hide file tree
Showing 13 changed files with 535 additions and 108 deletions.
17 changes: 14 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# 生产环境
# 请求地址
VITE_APP_API_BASEURL = '/'
# APP 名称
VITE_APP_TITLE = 'uniAppTemplate'

# APP ID
VITE_UNI_APPID = ''
# 微信小程序 APP ID
VITE_WX_APPID = 'wxb56964dd28204de0'

# h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base
VITE_APP_PUBLIC_BASE = /

# h5是否需要配置代理
VITE_APP_PROXY = false
VITE_APP_PROXY_PREFIX = '/api'
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
# 请求地址
# https://jsonplaceholder.typicode.com 免费模拟数据
VITE_APP_API_BASEURL = 'https://jsonplaceholder.typicode.com'

# storage前缀
VITE_APP_PREFIX = 'storage'
8 changes: 8 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 生产环境

# 请求地址
# https://jsonplaceholder.typicode.com 免费模拟数据
VITE_APP_API_BASEURL = 'https://jsonplaceholder.typicode.com'

# storage前缀
VITE_APP_PREFIX = 'storage'
55 changes: 55 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# 工作流的名称,如果省略,则使用当前文件名
name: Auto Deploy

# 从工作流生成的工作流运行的名称,如果省略,则使用提交时的commit信息
run-name: Deploy by @${{ github.actor }}

# 触发部署的条件
on:
# 每当 push 到 master 分支时触发部署
push:
branches:
- main

# 当前流程要执行的任务,可以是多个。[my_first_job]就是一个任务
jobs:
my_first_job:
name: build-and-deploy
runs-on: ubuntu-latest

steps:
- name: Clone Code
uses: actions/checkout@v4
with:
fetch-depth: 0
uses: pnpm/action-setup@v2
with:
version: 6.32.9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Cache dependencies
uses: actions/cache@v4
- name: Install dependencies
run: pnpm install

- name: Run Build Script
run: pnpm run build

- name: Deploy to GitHub Pages
# 此actions的官方文档 https://github.com/JamesIves/github-pages-deploy-action
uses: JamesIves/github-pages-deploy-action@v4
with:
# 要部署的文件夹,必填
folder: dist/build/h5
# 希望部署的分支,默认gh-pages
branch: gh-pages
# # 仓库范围的访问令牌,可以将个人令牌的值存储在GitHub Secrets中
# # 默认情况是不需要填的,如果您需要更多权限,例如部署到另一个存储库才需要填写
# # ACCESS_TOKEN 对应GitHub Secrets中设置的字段,不要照搬
# TOKEN: ${{ secrets.ACCESS_TOKEN }}
# # 部署到GitHub的不同仓库 <用户名>/<仓库名>
# # 此选项必须配置了TOKEN才能正常执行
# REPOSITORY-NAME: leoleor/leo2
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry = "http://registry.npmmirror.com"
95 changes: 95 additions & 0 deletions manifest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// manifest.config.ts
import { defineManifestConfig } from '@uni-helper/vite-plugin-uni-manifest'
import path from 'node:path'
import { loadEnv } from 'vite'

// 获取环境变量的范例
const env = loadEnv(process.env.NODE_ENV, path.resolve(process.cwd()))
const { VITE_APP_TITLE, VITE_UNI_APPID, VITE_WX_APPID, VITE_APP_PUBLIC_BASE } = env

export default defineManifestConfig({
name: VITE_APP_TITLE,
appid: VITE_UNI_APPID,
description: '',
versionName: '1.0.0',
versionCode: '100',
transformPx: false,
locale: 'zh-Hans',
h5: {
router: {
base: VITE_APP_PUBLIC_BASE
}
},
/* 5+App特有相关 */
'app-plus': {
usingComponents: true,
nvueStyleCompiler: 'uni-app',
compilerVersion: 3,
compatible: {
ignoreVersion: true
},
splashscreen: {
alwaysShowBeforeRender: true,
waiting: true,
autoclose: true,
delay: 0
},
/* 模块配置 */
modules: {},
/* 应用发布信息 */
distribute: {
/* android打包配置 */
android: {
minSdkVersion: 30,
targetSdkVersion: 30,
abiFilters: ['armeabi-v7a', 'arm64-v8a'],
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: VITE_WX_APPID,
setting: {
urlCheck: false
},
usingComponents: true
// __usePrivacyCheck__: true,
},
'mp-alipay': {
usingComponents: true,
styleIsolation: 'shared'
},
'mp-baidu': {
usingComponents: true
},
'mp-toutiao': {
usingComponents: true
},
uniStatistics: {
enable: false
},
vueVersion: '3'
})
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
"@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
"@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
"@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
"@iconify-json/ep": "^1.1.15",
"@uni-helper/vite-plugin-uni-manifest": "^0.2.6",
"@unocss/preset-legacy-compat": "^0.59.4",
"@unocss/preset-uno": "^0.59.4",
"@vue/runtime-core": "^3.2.45",
Expand Down
Loading

0 comments on commit 767b1ba

Please sign in to comment.