自定义项目配置

用户可以自定义项目配置

需要在项目根目录里新建类似quickConfig.json,wxConfig这样独立的配置文件。

  1. ├── package.json
  2. ├── quickConfig.json
  3. └── source

比如 quickConfig.json,需要指定快应用引擎,微信支付,分包配置文件内容参照快应用 manifest.json 配置文档。

  1. {
  2. "package": "com.qunar.quick",
  3. "name": "去哪儿旅行",
  4. "versionName": "3.0.7",
  5. "versionCode": 57,
  6. "minPlatformVersion": 1030,
  7. "icon": "/assets/image/qlog.png",
  8. "features": [
  9. {
  10. "name": "service.wxpay",
  11. "params": {
  12. "url": "https://xxx.yyy.com/touch/wechatTransition"
  13. }
  14. }
  15. ],
  16. "subpackages": [
  17. {
  18. "name": "hotel",
  19. "resource": "pages/hotel"
  20. },
  21. {
  22. "name": "ticket",
  23. "resource": "pages/ticket"
  24. },
  25. {
  26. "name": "train",
  27. "resource": "pages/train"
  28. },
  29. {
  30. "name": "vacation",
  31. "resource": "pages/vacation"
  32. }
  33. ]
  34. }

又如 wxConfig.json需要处理权限参见https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html

  1. {
  2. "permission": {
  3. "scope.userLocation": {
  4. "desc": "你的位置信息将用于小程序位置接口的效果展示"
  5. }
  6. }
  7. }