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
exports in package.json break dynamic imports with webpack #3384
Comments
@azul What about your own easy workaround you posted in the other thread? Did you find an issue with it? I would have expected to have seen it attached to this issue if it's a work-around. |
What are all other Webpack uses doing? We have been using Of course as mentioned this is truly a Webpack bug and needs to just be fixed on that side. |
Ping. |
Thanks for the reminder. There are other dependency issues between version 11 of highlight js and tiptap1 that mean we need to stick to version 10 until we managed to migrate to tiptap 2. But that's unrelated so i'll close this issue. |
@azul unfortunately this doesn't work for libraries, because npm can flatten packages:
|
I can't upgrade because I use dynamic imports: https://github.com/JetBrains/ring-ui/blob/master/components/code/code.js#L15. It works with v10 but not with v11 |
@Hypnosphi Have you commented on the bug/issue over in webpack? I'm also potentially assuming there is a good/reasonable workaround (since this issue is so quiet), but that no one has popped up yet to tell us what it is. |
@joshgoebel no, but they weren't asking how people deal with it |
Describe the issue/behavior that seems buggy
Webpack currently does not understand wildcard exports when processing dynamic imports.
This is a bug in webpack.
Trying to build a package that uses dynamic imports from
highlights.js
from version 11 on will result inSample Code or Instructions to Reproduce
This was already reported here but i think it's unrelated to the bug report it was submitted to.
Attempting to build this code with webpack will result in the error emssage mentioned above:
Expected behavior
The build should succeed providing the languages as separate artifacts to be dynamically imported.
Additional context
It looks like webpack currently does not implement handling the combination of exports specified in
package.json
and dynamic imports at all. So it might take some time until this is fixed on the webpack side of things. That's why i am proposing to look into a workaround inhighlight.js
as dynamic imports seem very relevant given the large number of language files.The text was updated successfully, but these errors were encountered: