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
Optimize a dependency aliased to an absolute path #1302
Comments
For more context, my project is linked to local clones of packages that also depend on React. |
Perhaps, instead of using edit: Hmm, I don't think this is a viable workaround, as the optimizer has already duplicated React by the time my |
I think we can add a |
Sounds good to me. I was about to make a plugin for it, but built-in is better in this case. |
Wait, if a dependency is optimized it already always uses the optimized version without the need for an alias. |
The optimizer is duplicating React for me. I'll make a repro. |
My current workaround: https://github.com/alloc/vite-plugin-dedupe |
I need to optimize
react
since it uses CommonJS modules, but I also need to force all packages to use the same copy of React, which I accomplish via thealias
option in my Vite config. Unfortunately, these two needs are in conflict, as the import rewriter doesn't check if an absolute path is optimized.The text was updated successfully, but these errors were encountered: