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

主包加载了分包的js文件,导致 vendor.js 过大 #650

Closed
CaptainLiao opened this issue Aug 9, 2019 · 2 comments
Closed

主包加载了分包的js文件,导致 vendor.js 过大 #650

CaptainLiao opened this issue Aug 9, 2019 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@CaptainLiao
Copy link

问题描述
在 uniapp 中使用分包,build 编译成功后,发现 vendor.js 文件引入了在分包中的 .js 文件,导致主包过大。无法上传到微信小程序。

复现

分包
"subPackages": [
{
"root": "packageA",
"pages": [...]
}
]
在分包 packageA 中新建 test.js 文件,内容如下:
export default function a() {
const b = '测试分包内容';
return b;
}
以微信小程序模式 build,编译后,在 dist\build\mp-weixin\common\vendor.js 中可见分包 packageA 中的 test.js 内容。

test.js 不应该出现在主包的 vendor.js 内

@fxy060608 fxy060608 self-assigned this Aug 9, 2019
@fxy060608 fxy060608 added the bug Something isn't working label Aug 9, 2019
@itzwg
Copy link

itzwg commented Jul 24, 2023

同样的问题,加入"optimization": { "subPackages": true } 无效
image

@Vanisper
Copy link

同样的问题,加入"optimization": { "subPackages": true } 无效 image

看我发的issue #5025

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants