manifest.config.ts 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. const env = loadEnv(process.env.NODE_ENV!, path.resolve(process.cwd(), 'env'))
  7. const {
  8. VITE_APP_TITLE,
  9. VITE_UNI_APPID,
  10. VITE_WX_APPID,
  11. VITE_APP_PUBLIC_BASE,
  12. VITE_FALLBACK_LOCALE,
  13. } = env
  14. export default defineManifestConfig({
  15. name: VITE_APP_TITLE,
  16. appid: VITE_UNI_APPID,
  17. description: '',
  18. versionName: '1.0.0',
  19. versionCode: '100',
  20. transformPx: false,
  21. locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
  22. h5: {
  23. router: {
  24. base: VITE_APP_PUBLIC_BASE,
  25. },
  26. },
  27. /* 5+App特有相关 */
  28. 'app-plus': {
  29. usingComponents: true,
  30. nvueStyleCompiler: 'uni-app',
  31. compilerVersion: 3,
  32. compatible: {
  33. ignoreVersion: true,
  34. },
  35. splashscreen: {
  36. alwaysShowBeforeRender: true,
  37. waiting: true,
  38. autoclose: true,
  39. delay: 0,
  40. },
  41. /* 模块配置 */
  42. modules: {},
  43. /* 应用发布信息 */
  44. distribute: {
  45. /* android打包配置 */
  46. android: {
  47. minSdkVersion: 30,
  48. targetSdkVersion: 30,
  49. abiFilters: ['armeabi-v7a', 'arm64-v8a'],
  50. permissions: [
  51. '<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>',
  52. '<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>',
  53. '<uses-permission android:name="android.permission.VIBRATE"/>',
  54. '<uses-permission android:name="android.permission.READ_LOGS"/>',
  55. '<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>',
  56. '<uses-feature android:name="android.hardware.camera.autofocus"/>',
  57. '<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>',
  58. '<uses-permission android:name="android.permission.CAMERA"/>',
  59. '<uses-permission android:name="android.permission.GET_ACCOUNTS"/>',
  60. '<uses-permission android:name="android.permission.READ_PHONE_STATE"/>',
  61. '<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>',
  62. '<uses-permission android:name="android.permission.WAKE_LOCK"/>',
  63. '<uses-permission android:name="android.permission.FLASHLIGHT"/>',
  64. '<uses-feature android:name="android.hardware.camera"/>',
  65. '<uses-permission android:name="android.permission.WRITE_SETTINGS"/>',
  66. ],
  67. },
  68. /* ios打包配置 */
  69. ios: {},
  70. /* SDK配置 */
  71. sdkConfigs: {},
  72. /* 图标配置 */
  73. icons: {
  74. android: {
  75. hdpi: 'static/app/icons/72x72.png',
  76. xhdpi: 'static/app/icons/96x96.png',
  77. xxhdpi: 'static/app/icons/144x144.png',
  78. xxxhdpi: 'static/app/icons/192x192.png',
  79. },
  80. ios: {
  81. appstore: 'static/app/icons/1024x1024.png',
  82. ipad: {
  83. app: 'static/app/icons/76x76.png',
  84. 'app@2x': 'static/app/icons/152x152.png',
  85. notification: 'static/app/icons/20x20.png',
  86. 'notification@2x': 'static/app/icons/40x40.png',
  87. 'proapp@2x': 'static/app/icons/167x167.png',
  88. settings: 'static/app/icons/29x29.png',
  89. 'settings@2x': 'static/app/icons/58x58.png',
  90. spotlight: 'static/app/icons/40x40.png',
  91. 'spotlight@2x': 'static/app/icons/80x80.png',
  92. },
  93. iphone: {
  94. 'app@2x': 'static/app/icons/120x120.png',
  95. 'app@3x': 'static/app/icons/180x180.png',
  96. 'notification@2x': 'static/app/icons/40x40.png',
  97. 'notification@3x': 'static/app/icons/60x60.png',
  98. 'settings@2x': 'static/app/icons/58x58.png',
  99. 'settings@3x': 'static/app/icons/87x87.png',
  100. 'spotlight@2x': 'static/app/icons/80x80.png',
  101. 'spotlight@3x': 'static/app/icons/120x120.png',
  102. },
  103. },
  104. },
  105. },
  106. },
  107. /* 快应用特有相关 */
  108. quickapp: {},
  109. /* 小程序特有相关 */
  110. 'mp-weixin': {
  111. appid: VITE_WX_APPID,
  112. setting: {
  113. urlCheck: false,
  114. },
  115. usingComponents: true,
  116. permission: {
  117. 'scope.userFuzzyLocation': {
  118. desc: '你的位置信息将用于小程序的位置接口的效果展示',
  119. },
  120. },
  121. requiredPrivateInfos: ['getFuzzyLocation'],
  122. // __usePrivacyCheck__: true,
  123. },
  124. 'mp-alipay': {
  125. usingComponents: true,
  126. styleIsolation: 'shared',
  127. },
  128. 'mp-baidu': {
  129. usingComponents: true,
  130. },
  131. 'mp-toutiao': {
  132. usingComponents: true,
  133. },
  134. uniStatistics: {
  135. enable: false,
  136. },
  137. vueVersion: '3',
  138. })