The common library built based on wepback, external dependencies do not work properly #19409
Unanswered
JinHe-PerkinElmer
asked this question in
Q&A
Replies: 2 comments
-
@JinHe-PerkinElmer Please don't ignore |
Beta Was this translation helpful? Give feedback.
0 replies
-
webpack-externals-demo.zip |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Bug report
The common library built based on wepback, external dependencies do not work properly. An error is reported at runtime, it seems that the externals are not correctly parsed from the outside, but from the node_modules of common-lib.
What is the current behavior?
I build a UI common-lib base on webpack, it mainly includes ant-d and react as external dependencies. The webpack configuration is fine and the packaging is successful. But an error is reported during runtime.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Wepback externals can work properly.
Other relevant information:
webpack version: ^5.97.1
Node.js version: v22.14.0
Operating System: win10
Additional tools:
My package.json
webpack.config.js
Evidence that external dependencies don't work
we can see that the external dependency
antd
is not resolved from the outside when running, but from the inside of common-libDoes anyone know what the reason is? @alexander-akait thanks very much.
Beta Was this translation helpful? Give feedback.
All reactions