uniapp 微信小程序开启分包

uniapp yekong

uniapp 微信小程序开启分包

增加一个packages目录然后在pages.json内添加分包内容

{
	"pages": [{
		"path": "pages/home/home",
		"style": {
			"navigationStyle": "custom",
			"navigationBarTextStyle": "black"
		}
	}, {
		"path": "pages/login/wxlogin",
		"style": {
			"navigationBarTitleText": "微信登录",
			"navigationBarTextStyle": "black",
			"navigationBarBackgroundColor": "#ffffff"
		}
	}],
	"subPackages": [{
		"root": "packages",
		"pages": [{
				"path": "pages/my/withdraw/withdraw",
				"style": {
					"navigationBarTitleText": "提现",
					"navigationBarTextStyle": "white",
					"navigationBarBackgroundColor": "#2662EB"
				}
			}
		]
	}]
}

在manifest.json源码模式内添加分包优化代码
wanjunshijiecom 2022-02-04 at 09.11.34

    "mp-weixin" : {
        "appid" : "",
        "setting" : {
            "urlCheck" : false,
            "minified" : true
        },
        "optimization" : {
            "subPackages" : true
        },
        "runmode" : "liberate",
        "usingComponents" : true
    },
喜欢