Skip to content
New issue

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

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

Already on GitHub? # to your account

3.0.0 不支持分包优化? #3452

Closed
zhuscat opened this issue Apr 20, 2022 · 3 comments
Closed

3.0.0 不支持分包优化? #3452

zhuscat opened this issue Apr 20, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request mp mini program vue3

Comments

@zhuscat
Copy link

zhuscat commented Apr 20, 2022

问题描述

分包优化具体逻辑:
静态文件:分包下支持 static 等静态资源拷贝,即分包目录内放置的静态资源不会被打包到主包中,也不可在主包中使用
js文件:当某个 js 仅被一个分包引用时,该 js 会被打包到该分包内,否则仍打到主包(即被主包引用,或被超过 1 个分包引用)
自定义组件:若某个自定义组件仅被一个分包引用时,且未放入到分包内,编译时会输出提示信息

官方文档中是这样写的,但是发现 3.0.0 似乎不支持分包优化,只被分包用到的 js 文件还是会被打到主包里

预期结果

能够分包优化

实际结果

不能分包优化

系统信息:

  • 发行平台: 微信小程序
  • uni-app版本: 3.0.0-alpha-3031320220314002
@fxy060608
Copy link
Collaborator

暂不支持对node_modules中的内容做分包优化,仅分包使用的js文件,可以直接放入到分包目录引用

@fxy060608 fxy060608 self-assigned this Apr 20, 2022
@fxy060608 fxy060608 added enhancement New feature or request vue3 mp mini program labels Apr 20, 2022
@LiZhequ
Copy link

LiZhequ commented May 15, 2023

有计划对uni-app3做分包优化的支持吗,我看到目前为止任不支持,文档也没明确指出不支持

@Vanisper
Copy link

看我的解决办法
#5025

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request mp mini program vue3
Projects
None yet
Development

No branches or pull requests

4 participants