-
Notifications
You must be signed in to change notification settings - Fork 62
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
How to alias externaled module path? #66
Comments
@ycjcl868 same question, looks like that you had avoided this by giving up external。 |
SSR bundle all not set alias in umi 3.2.0 |
@ycjcl868 just to make sure i understood - do you need to bundle |
I think they had a resolve alias for react but Webpack was requiring react as an external dependency instead of their aliased module. I just ran into a similar issue with lodash-es, which doesn't work in a node runtime. I tried to rewrite the import to lodash resolve: {
alias: {
"lodash-es": "lodash"
}
} but Webpack was still requiring lodash-es. I was able to work around it with the following. externals: [
nodeExternals({ allowlist: ["lodash-es"] }),
{ "lodash-es": "commonjs lodash" }
] Note that the resolve alias is not necessary in this case. This seems to be an issue with Webpack but it might be nice to add an API to this module to rewrite external modules. |
There's a problem for me to do SSR building, it's our framework export alias module, and use
resolve.alias
to alias the module , like React, we useso now, I only add
bar/lib/sdk/react
intowhiteList
, but it's unconscionable to bundle all React library.How could I solve the problem?
The text was updated successfully, but these errors were encountered: