Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持构建独立分包吗 #1

Open
liuweiGL opened this issue Sep 14, 2024 · 3 comments
Open

支持构建独立分包吗 #1

liuweiGL opened this issue Sep 14, 2024 · 3 comments

Comments

@liuweiGL
Copy link

构建独立分包应该要把 runtime 拆分成多个吧,我看文档里面的截图只有一个,冒昧的请假一下

@WangZhenHao
Copy link
Owner

支持小程序的独立分包,runtime.js和common.js 这两个文件是公共代码,减少代码体积

@liuweiGL
Copy link
Author

liuweiGL commented Sep 15, 2024 via email

@WangZhenHao
Copy link
Owner

WangZhenHao commented Sep 15, 2024

common.js的代码生成规则是:模块引用次数大于3而且 大于1kb的时候,提到common.js。

如果分包的页面的js,引入了三次以上,而且大于1kb,就会提取到common.js. 分包才会自动引入common.js文件

如果你的分包代码,没有引入三次以上,而且大于1kb,是不会放到common.js里面的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants