-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
dev下,esm的包不会自动按需加载 #3625
Comments
webpack默认也不会实现该功能,如果需要的话试试这个 https://www.rspack.dev/config/builtins.html#builtinspluginimport |
我用cra建的项目默认是支持这个功能的,就是上面第二张图,没有做任何额外的配置。builtins.import 现在无法满足我的诉求,因为需要定义不同的customName |
我没有在cra的文档上找到支持该功能,请提供可复现的cra的demo |
|
经确认,这个其实是webpack的一个treeshaking优化,当手动配置 antd的package.json的sideEffects:true的时候,导入路径就变成了 |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
just a gentle nudge, @IWANABETHATGUY @hardfist on this bug for an approx ETA . |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
You can try with config below: +experiments {
+ rspackFuture {
+ newTreeshaking: true
+ }
+} |
System Info
System:
OS: macOS 13.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 11.04 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Browsers:
Chrome: 114.0.5735.133
Safari: 16.2
Safari Technology Preview: 14.1
Details
现象:
期望像 webapck 一样:
demo 中只是用 antd 举例,实际使用中依赖的三方包导出不规范, 如果使用 babel-import-plugin ,需要定义不同的customName
Reproduce link
https://github.com/July-ing/rspack-demo
Reproduce Steps
pnpm dev
The text was updated successfully, but these errors were encountered: