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

Uniapp打包编译小程序时Node-modules被打入主包问题 #5218

Closed
doggyegg opened this issue Nov 8, 2024 · 2 comments
Closed

Uniapp打包编译小程序时Node-modules被打入主包问题 #5218

doggyegg opened this issue Nov 8, 2024 · 2 comments
Labels

Comments

@doggyegg
Copy link

doggyegg commented Nov 8, 2024

Uniapp编译小程序,仅在子包中引用的node-modules依赖也会被打入主包及vendor.js中,导致主包异常的大

@Ldxxxxxxxx
Copy link

把项目根目录下的components和uni_modules移动到子包的目录下,或者可以使用webpack-node-externals这个库来排除node_modules

@Otto-J Otto-J added the 评论中有最佳答案 replay best label Feb 25, 2025
@Otto-J
Copy link
Member

Otto-J commented Feb 25, 2025

参考楼上回复,如果仍有问题,请开新贴提问,带着复现工程。提供更多信息,有助于定位和解答你的问题。

@Otto-J Otto-J closed this as completed Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants