收藏
回答

第三方分包加载无法预览

框架类型 终端类型 微信版本 基础库版本
小程序 工具 6.6.3 1.9.8

我是第三方开发平台,由于包太大就做了分包加载,在编辑器上运行和上传都没有问题,但是预览的时候就包“无效的json文件”,却不报具体位置,这很让人头疼,是不是第三方的ext.json不能配置分包加载?

回答关注问题邀请回答
收藏

16 个回答

  • 2018-02-07

    这是ext.json

    {

    "extEnable": true,

    "extAppid": "wxa1bd86cdf47df34e",

    "pages": [

    "pages/index/index",

    "pages/category/category",

    "pages/cart/cart",

    "pages/member/index/index",

    "pages/address/add/add",

    "pages/address/list/list",

    "pages/address/select/index",

    "pages/allActivity/allActivity",

    "pages/area/index/index",

    "pages/article/detail/detail",

    "pages/article/list/list",

    "pages/bargain/bargain/index",

    "pages/bargain/cashier/index",

    "pages/bargain/detail/index",

    "pages/bargain/index/index",

    "pages/bargain/list/index",

    "pages/canyin/index",

    "pages/chainPage/chainPage",

    "pages/commission/QRcode/QRcode",

    "pages/commission/Withdraw/Withdraw",

    "pages/commission/WithdrawDetail/WithdrawDetail",

    "pages/commission/WithdrawDetailMoney/WithdrawDetailMoney",

    "pages/commission/agreement/agreement",

    "pages/commission/distributionPrice/distributionPrice",

    "pages/commission/logs/logs",

    "pages/commission/orderForm/orderForm",

    "pages/commission/register/index",

    "pages/commission/shopStore/index",

    "pages/commission/team/team",

    "pages/consultation/consultationDetail/consultationDetail",

    "pages/consultation/reviewArea/reviewArea",

    "pages/consultation/consultation",

    "pages/customerForm/formDetail/formDetail",

    "pages/customerForm/formSuccess/formSuccess",

    "pages/customerForm/customerForm",

    "pages/expressQuery/expressQuery",

    "pages/game/fruitMachine/fruitMachine",

    "pages/game/scratch/scratch",

    "pages/game/wheel/wheel",

    "pages/goods/detail/detail",

    "pages/goods/groupDetail/detail",

    "pages/goods/grouplist/list",

    "pages/goods/list/list",

    "pages/goods/priceKill/priceKill",

    "pages/goods/shop/introduceShop/introduceShop",

    "pages/goods/shop/shop",

    "pages/groupbuy/cashier/index",

    "pages/groupbuy/confirmOrder/index",

    "pages/groupbuy/detail/index",

    "pages/groupbuy/fightGroups/index",

    "pages/groupbuy/groupList/detail/index",

    "pages/groupbuy/groupList/index",

    "pages/groupbuy/index/index",

    "pages/groupbuy/list/index",

    "pages/groupbuy/openGroups/index",

    "pages/indexpage/indexpage",

    "pages/member/aboutus/aboutus",

    "pages/member/activeCard/consumption/consumption",

    "pages/member/activeCard/integralSum/integralSum",

    "pages/member/activeCard/activeCard",

    "pages/member/allTool/details/index",

    "pages/member/allTool/groupbuy/index",

    "pages/member/allTool/allTool",

    "pages/member/collect/collect",

    "pages/member/coupon/Couponcenter/Couponcenter",

    "pages/member/coupon/couponDetail/couponDetail",

    "pages/member/coupon/getCoupon/getCoupon",

    "pages/member/coupon/myCoupon/myCoupon",

    "pages/member/coupon/index",

    "pages/member/evaluate/addevaluate/index",

    "pages/member/evaluate/evaluate",

    "pages/member/groupActivity/activityIntroduce/activityIntroduce",

    "pages/member/groupActivity/activityType/activityType",

    "pages/member/groupActivity/addType/addType",

    "pages/member/groupActivity/allChannel/allChannel",

    "pages/member/groupActivity/changeImg/changeImg",

    "pages/member/groupActivity/channel/channel",

    "pages/member/groupActivity/establishActivity/establishActivity",

    "pages/member/groupActivity/userInformation/userInformation",

    "pages/member/groupActivity/groupActivity",

    "pages/member/integral/address/detail/index",

    "pages/member/integral/address/list/index",

    "pages/member/integral/detail/index",

    "pages/member/integral/exchange/index",

    "pages/member/integral/home/index",

    "pages/member/integral/integral/index",

    "pages/member/integral/received/index",

    "pages/member/integral/recording/index",

    "pages/member/jump/jump",

    "pages/member/membership/index",

    "pages/member/membership/cardInfo/cardInfo",

    "pages/member/membership/cardOpen/cardOpen",

    "pages/member/membership/cardSuccess/cardSuccess",

    "pages/member/money/money",

    "pages/member/point/point",

    "pages/member/registered/index",

    "pages/member/sign/detail/detail",

    "pages/member/sign/sign",

    "pages/merchants/article/index",

    "pages/notice/detail/detail",

    "pages/notice/list/list",

    "pages/order/checkout/checkout",

    "pages/order/complaint/complaint",

    "pages/order/complaintEvery/complaintEvery",

    "pages/order/details/index",

    "pages/order/list/list",

    "pages/order/logistics/index",

    "pages/order/mendian/index",

    "pages/order/myQuestion/myQuestion",

    "pages/order/orderpay/payment",

    "pages/order/ordersubmit/index",

    "pages/order/payment/payment",

    "pages/order/pinjia/index",

    "pages/order/refund/refundDetails/refundDetails",

    "pages/order/refund/refund",

    "pages/order/refundGoods/refundGoods",

    "pages/order/success/index",

    "pages/register/index",

    "pages/search/index",

    "pages/seller/goods",

    "pages/seller/index",

    "pages/services/category/category",

    "pages/services/detail/index",

    "pages/services/list/index",

    "pages/services/list_detail/index",

    "pages/services/search/search",

    "pages/services/services_pinjia/index",

    "pages/shoppage/list/index",

    "pages/shoppage/index",

    "pages/supdem/detialInfo/detialInfo",

    "pages/supdem/exhibit/exhibit",

    "pages/supdem/mydetialInfo/mydetialInfo",

    "pages/supdem/myexhibit/myexhibit",

    "pages/supdem/supdem",

    "pages/video/detail/index",

    "pages/video/list/index"

    ],

    "window": {

    "navigationBarBackgroundColor": "#fff",

    "navigationBarTitleText": "阳光在线旅游222222",

    "navigationBarTextStyle": "black",

    "enablePullDownRefresh": true

    },

    "subPackages": [

    {

    "root": "packageA",

    "pages": [

    "pages/community/complaints/index",

    "pages/community/index/index",

    "pages/community/list/Essencearea/index",

    "pages/community/list/Relatedsections/index",

    "pages/community/list/index/index",

    "pages/community/p_topic/index",

    "pages/community/person/center",

    "pages/community/plate/index",

    "pages/community/topic/index"

    ]

    }

    ],

    "tabBar": {

    "list": [

    {

    "pagePath": "pages/index/index",

    "iconPath": "images/icon_home.png",

    "selectedIconPath": "images/icon_home_selected.png",

    "text": "首页"

    },

    {

    "pagePath": "pages/category/category",

    "iconPath": "images/icon_cate.png",

    "selectedIconPath": "images/icon_cate_selected.png",

    "text": "分类"

    },

    {

    "pagePath": "pages/cart/cart",

    "iconPath": "images/icon_cart.png",

    "selectedIconPath": "images/icon_cart_selected1.png",

    "text": "购物车"

    },

    {

    "pagePath": "pages/member/index/index",

    "iconPath": "images/icon_member.png",

    "selectedIconPath": "images/icon_member_selected.png",

    "text": "我"

    }

    ]

    },

    "ext": {

    "new": 3,

    "uniacid": "8419",

    "tabBarPage": [

    "/pages/index/index",

    "/pages/category/category",

    "/pages/cart/cart",

    "/pages/member/index/index"

    ]

    }

    }


    2018-02-07
    有用
    回复
  • 2018-02-07

    这是app.json

    {

    "pages": [

    "pages/index/index",

    "pages/category/category",

    "pages/cart/cart",

    "pages/member/index/index",

    "pages/address/add/add",

    "pages/address/list/list",

    "pages/address/select/index",

    "pages/allActivity/allActivity",

    "pages/area/index/index",

    "pages/article/detail/detail",

    "pages/article/list/list",

    "pages/bargain/bargain/index",

    "pages/bargain/cashier/index",

    "pages/bargain/detail/index",

    "pages/bargain/index/index",

    "pages/bargain/list/index",

    "pages/canyin/index",

    "pages/chainPage/chainPage",

    "pages/commission/QRcode/QRcode",

    "pages/commission/Withdraw/Withdraw",

    "pages/commission/WithdrawDetail/WithdrawDetail",

    "pages/commission/WithdrawDetailMoney/WithdrawDetailMoney",

    "pages/commission/agreement/agreement",

    "pages/commission/distributionPrice/distributionPrice",

    "pages/commission/logs/logs",

    "pages/commission/orderForm/orderForm",

    "pages/commission/register/index",

    "pages/commission/shopStore/index",

    "pages/commission/team/team",

    "pages/consultation/consultationDetail/consultationDetail",

    "pages/consultation/reviewArea/reviewArea",

    "pages/consultation/consultation",

    "pages/customerForm/formDetail/formDetail",

    "pages/customerForm/formSuccess/formSuccess",

    "pages/customerForm/customerForm",

    "pages/expressQuery/expressQuery",

    "pages/game/fruitMachine/fruitMachine",

    "pages/game/scratch/scratch",

    "pages/game/wheel/wheel",

    "pages/goods/detail/detail",

    "pages/goods/groupDetail/detail",

    "pages/goods/grouplist/list",

    "pages/goods/list/list",

    "pages/goods/priceKill/priceKill",

    "pages/goods/shop/introduceShop/introduceShop",

    "pages/goods/shop/shop",

    "pages/groupbuy/cashier/index",

    "pages/groupbuy/confirmOrder/index",

    "pages/groupbuy/detail/index",

    "pages/groupbuy/fightGroups/index",

    "pages/groupbuy/groupList/detail/index",

    "pages/groupbuy/groupList/index",

    "pages/groupbuy/index/index",

    "pages/groupbuy/list/index",

    "pages/groupbuy/openGroups/index",

    "pages/indexpage/indexpage",

    "pages/member/aboutus/aboutus",

    "pages/member/activeCard/consumption/consumption",

    "pages/member/activeCard/integralSum/integralSum",

    "pages/member/activeCard/activeCard",

    "pages/member/allTool/details/index",

    "pages/member/allTool/groupbuy/index",

    "pages/member/allTool/allTool",

    "pages/member/collect/collect",

    "pages/member/coupon/Couponcenter/Couponcenter",

    "pages/member/coupon/couponDetail/couponDetail",

    "pages/member/coupon/getCoupon/getCoupon",

    "pages/member/coupon/myCoupon/myCoupon",

    "pages/member/coupon/index",

    "pages/member/evaluate/addevaluate/index",

    "pages/member/evaluate/evaluate",

    "pages/member/groupActivity/activityIntroduce/activityIntroduce",

    "pages/member/groupActivity/activityType/activityType",

    "pages/member/groupActivity/addType/addType",

    "pages/member/groupActivity/allChannel/allChannel",

    "pages/member/groupActivity/changeImg/changeImg",

    "pages/member/groupActivity/channel/channel",

    "pages/member/groupActivity/establishActivity/establishActivity",

    "pages/member/groupActivity/userInformation/userInformation",

    "pages/member/groupActivity/groupActivity",

    "pages/member/integral/address/detail/index",

    "pages/member/integral/address/list/index",

    "pages/member/integral/detail/index",

    "pages/member/integral/exchange/index",

    "pages/member/integral/home/index",

    "pages/member/integral/integral/index",

    "pages/member/integral/received/index",

    "pages/member/integral/recording/index",

    "pages/member/integral/success/index",

    "pages/member/jump/jump",

    "pages/member/membership/index",

    "pages/member/membership/cardInfo/cardInfo",

    "pages/member/membership/cardOpen/cardOpen",

    "pages/member/membership/cardSuccess/cardSuccess",

    "pages/member/money/money",

    "pages/member/point/point",

    "pages/member/registered/index",

    "pages/member/sign/detail/detail",

    "pages/member/sign/sign",

    "pages/merchants/article/index",

    "pages/notice/detail/detail",

    "pages/notice/list/list",

    "pages/order/checkout/checkout",

    "pages/order/complaint/complaint",

    "pages/order/complaintEvery/complaintEvery",

    "pages/order/details/index",

    "pages/order/list/list",

    "pages/order/logistics/index",

    "pages/order/mendian/index",

    "pages/order/myQuestion/myQuestion",

    "pages/order/orderpay/payment",

    "pages/order/ordersubmit/index",

    "pages/order/payment/payment",

    "pages/order/pinjia/index",

    "pages/order/refund/refundDetails/refundDetails",

    "pages/order/refund/refund",

    "pages/order/refundGoods/refundGoods",

    "pages/order/success/index",

    "pages/register/index",

    "pages/search/index",

    "pages/seller/goods",

    "pages/seller/index",

    "pages/services/category/category",

    "pages/services/detail/index",

    "pages/services/list/index",

    "pages/services/list_detail/index",

    "pages/services/search/search",

    "pages/services/services_pinjia/index",

    "pages/shoppage/list/index",

    "pages/shoppage/index",

    "pages/supdem/detialInfo/detialInfo",

    "pages/supdem/exhibit/exhibit",

    "pages/supdem/mydetialInfo/mydetialInfo",

    "pages/supdem/myexhibit/myexhibit",

    "pages/supdem/supdem",

    "pages/video/detail/index",

    "pages/video/list/index"

    ],

    "window": {

    "backgroundTextStyle": "light",

    "navigationBarBackgroundColor": "#fff",

    "navigationBarTitleText": "WeChat",

    "navigationBarTextStyle": "black"

    },

    "subPackages": [

    {

    "root": "packageA",

    "pages": [

    "pages/community/complaints/index",

    "pages/community/index/index",

    "pages/community/list/Essencearea/index",

    "pages/community/list/Relatedsections/index",

    "pages/community/list/index/index",

    "pages/community/p_topic/index",

    "pages/community/person/center",

    "pages/community/plate/index",

    "pages/community/topic/index"

    ]

    }

    ],

    "tabBar": {

    "list": [

    {

    "pagePath": "pages/index/index",

    "iconPath": "images/icon_home.png",

    "selectedIconPath": "images/icon_home_selected.png",

    "text": "首页"

    },

    {

    "pagePath": "pages/goods/list/list",

    "iconPath": "images/icon_cate.png",

    "selectedIconPath": "images/icon_cate_selected.png",

    "text": "分类"

    },

    {

    "pagePath": "pages/cart/cart",

    "iconPath": "images/icon_cart.png",

    "selectedIconPath": "images/icon_cate_selected.png",

    "text": "购物车"

    },

    {

    "pagePath": "pages/member/index/index",

    "iconPath": "images/icon_member.png",

    "selectedIconPath": "images/icon_member_selected.png",

    "text": "我"

    }

    ]

    }

    }


    2018-02-07
    有用
    回复
  • 2018-02-07

    因为代码超出了2M,所以做了分包处理,如果无法预览调试的话,非常影响开发效率,希望官方能够解决这个问题,感谢您的回复。

    2018-02-07
    有用
    回复
  • oric
    oric
    2018-02-07

    可以麻烦分别贴一下app.json和ext.json里面的pages和subpackage的配置吗?

    2018-02-07
    有用
    回复
  • oric
    oric
    2018-02-07

    你好,暂时不支持在ext.json里面配置subpackage字段。

    使用了分包的情况下,ext.json配置pages字段预览有问题,如不必要的话可以先去掉,或者直接上传不影响后续。

    2018-02-07
    有用
    回复 9
    • 灏
      2018-07-03
      1. 不加pages的话,底部自定义导航就做不了

      2. 如不必要的话可以先去掉,或者直接上传不影响后续。  会影响,点击分包相关路径直接报找不到路径了

      2018-07-03
      回复
    • oric
      oric
      2018-07-06回复

      收到你私下给的文档了,ext.json和app.json里的pages/tabBar一样,不明白具体是改变什么配置?我理解你是要在tabBar中添加模版中不存在的page?

      ext.json配置的pages只能取模版app.json的pages的子集,添加page会报错。建议模版中pages包括所有的页面。

      如果模版配置了分包,暂时不支持在ext.json里面配置pages/subpackages字段。

      所以你的需求可以这样实现1.模版pages括所有的页面. 2.去掉ext.json中的pages配置,只配置tabBar

      2018-07-06
      回复
    • 灏
      2018-07-06回复oric
      1. 背景是这样的,我这里是小程序第三方服务商

      2. 同一套模板,不同用户底部tabBar顺序是不一样的,也就是说tabBar的首个导航路径和app.json中的pages的第一个路径不一样,就会导致底部导航加载不出来


      2018-07-06
      回复
    • 小8
      小8
      2018-07-06回复oric

      需求应该是这样的

      一份代码,一份app.json

      A小程序的ext.json 定义tab 是 页面T1,页面T2,页面T3,对应的pages的第一条是T1的页面

      B小程序的ext.json 定义tab是 页面T3,页面T5,页面T4,对应的pages的第一条是T3的页面

      C小程序的ext.json 定义tab是 页面T6,页面T7,页面T8,对应的pages的第一条是T6的页面

      2018-07-06
      回复
    • oric
      oric
      2018-07-06回复小8

      了解了,需要修改进入页面。

      我支持一下,上线了这边回复你

      2018-07-06
      回复
    查看更多(4)
  • 2018-02-07

    wxfb35c30d70baf029,现在没有上线分包的版本

    2018-02-07
    有用
    回复

正在加载...

登录 后发表内容