Browse Source

开启小程序分包

xiaohaizhao 1 year ago
parent
commit
5cc85739f5
2 changed files with 88 additions and 70 deletions
  1. 82 70
      manifest.json
  2. 6 0
      pages.json

+ 82 - 70
manifest.json

@@ -1,28 +1,29 @@
 {
-    "name" : "智慧水务",
-    "appid" : "",
-    "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
-    "transformPx" : false,
+    "name": "智慧水务",
+    "appid": "",
+    "description": "",
+    "versionName": "1.0.0",
+    "versionCode": "100",
+    "transformPx": false,
     /* 5+App特有相关 */
-    "app-plus" : {
-        "usingComponents" : true,
-        "nvueStyleCompiler" : "uni-app",
-        "compilerVersion" : 3,
-        "splashscreen" : {
-            "alwaysShowBeforeRender" : false,
-            "waiting" : false,
-            "autoclose" : true,
-            "delay" : 0
+    "app-plus": {
+        "usingComponents": true,
+        "nvueStyleCompiler": "智慧水务",
+        "compilerVersion": 3,
+        "runmode": "liberate",
+        "splashscreen": {
+            "alwaysShowBeforeRender": false,
+            "waiting": false,
+            "autoclose": true,
+            "delay": 0
         },
         /* 模块配置 */
-        "modules" : {},
+        "modules": {},
         /* 应用发布信息 */
-        "distribute" : {
+        "distribute": {
             /* android打包配置 */
-            "android" : {
-                "permissions" : [
+            "android": {
+                "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\"/>",
@@ -41,79 +42,90 @@
                 ]
             },
             /* ios打包配置 */
-            "ios" : {},
+            "ios": {},
             /* SDK配置 */
-            "sdkConfigs" : {}
+            "sdkConfigs": {}
         }
     },
     /* 快应用特有相关 */
-    "quickapp" : {},
+    "quickapp": {},
     /* 小程序特有相关 */
-    "mp-weixin" : {
-        "appid" : "wx08b337e860e3ea58",
-        "setting" : {
-            "urlCheck" : false,
-            "es6" : true,
-            "postcss" : true,
-            "minified" : true
+    "mp-weixin": {
+        "appid": "wx08b337e860e3ea58",
+        "setting": {
+            "urlCheck": false,
+            "es6": true,
+            "postcss": true,
+            "minified": true
         },
-        "usingComponents" : true,
-        "permission" : {
-            "scope.userLocation" : {
-                "desc" : "路线规划 标点"
+        "optimization": {
+            "subPackages": true
+        },
+        "usingComponents": true,
+        "permission": {
+            "scope.userLocation": {
+                "desc": "为了您更好的体验,请确认获取您的位置"
             }
-        }
+        },
+        "requiredPrivateInfos": ["getLocation"]
     },
-    "mp-alipay" : {
-        "usingComponents" : true
+    "mp-alipay": {
+        "usingComponents": true
     },
-    "mp-baidu" : {
-        "usingComponents" : true
+    "mp-baidu": {
+        "usingComponents": true
     },
-    "mp-toutiao" : {
-        "usingComponents" : true
+    "mp-toutiao": {
+        "usingComponents": true
     },
-    "uniStatistics" : {
-        "enable" : false
+    "uniStatistics": {
+        "enable": false
     },
-    "vueVersion" : "2",
-    "h5" : {
-        "router" : {
-            "mode" : "hash",
-            "base" : "./"
+    "vueVersion": "2",
+    "h5": {
+        "router": {
+            "mode": "hash",
+            "base": "./"
         },
-        "devServer" : {
-            "https" : false,
-            "disableHostCheck" : true,
-            "proxy" : {
-                "/apis1" : {
-                    "target" : "http://60.204.153.188",
-                    "changeOrigin" : true,
-                    "pathRewrite" : {
-                        "^/apis1" : ""
+        "devServer": {
+            "https": false,
+            "disableHostCheck": true,
+            "proxy": {
+                "/apis1": {
+                    "target": "http://60.204.153.188",
+                    "changeOrigin": true,
+                    "pathRewrite": {
+                        "^/apis1": ""
+                    }
+                },
+                "/apis": {
+                    "target": "https://oms.idcgroup.com.cn:8079",
+                    "changeOrigin": false,
+                    "pathRewrite": {
+                        "^/apis": ""
                     }
                 },
-                "/apis" : {
-                    "target" : "https://oms.idcgroup.com.cn:8079",
-                    "changeOrigin" : false,
-                    "pathRewrite" : {
-                        "^/apis" : ""
+                "/txwzfw": {
+                    "target": "https://apis.map.qq.com",
+                    "changeOrigin": false,
+                    "pathRewrite": {
+                        "^/txwzfw": ""
                     }
                 }
             }
         },
-        "optimization" : {
-            "treeShaking" : {
-                "enable" : true
+        "optimization": {
+            "treeShaking": {
+                "enable": true
             }
         },
-        "title" : "智慧水务",
-        "sdkConfigs" : {
-            "maps" : {
-                "qqmap" : {
-                    "key" : "UVVBZ-UOGWZ-ZUWXC-TJQMT-TUWLO-IVFTN"
+        "title": "智慧水务",
+        "sdkConfigs": {
+            "maps": {
+                "qqmap": {
+                    "key": "UVVBZ-UOGWZ-ZUWXC-TJQMT-TUWLO-IVFTN"
                 }
             }
         }
     }
-}
+}

+ 6 - 0
pages.json

@@ -14,6 +14,12 @@
 	}, {
 		"path": "pages/index/modules/mine"
 	}],
+	"subPackages": [{
+		"root": "packageA",
+		"pages": [{
+			"path": "facility/index"
+		}]
+	}],
 	"globalStyle": {
 		"navigationStyle": "custom"
 	},