-
-
Notifications
You must be signed in to change notification settings - Fork 534
Somewhere between version 5.10 & 5.11 dist files lost .js extension #1028
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
Comments
Hi @rosea1, can you provide some examples of the issue happening, please? With the examples, we can investigate to be sure that the dist files will work for all situations. |
Hi @danielbarion i unfortunately dont have time to set up an example however i can explain what i did.
In the repository i created a "wrapper" tooltip using styled-components like so;
The component library then gets built with the rollup command into CJS format. The other repository (built with create-react-app) imports this Tooltip component to use. Problem is that the import of react-tooltip fails, or moreover isnt giving expected results - RToolip is undefined; i used; Anyway i kept reverting versions until i found one with the .js extension (v.10) and it just worked so i put it down to this. |
I won't rule out that this might be happening because maybe we use some non-standard build options, but I believe this is definitely fixable by tweaking your own build config. If you ever get the time to create a minimal project reproducing this issue, we'll definitely check it out. Until then, unfortunately there's not much we can help with. |
What was the reasoning for removing the .js file extension though ? i cant see any reason why you would want to do that. Not many other packages do this? |
It was done in #984, and I'm not sure if there was a specific reason. @danielbarion or @GerkinDev can probably shed some light on this. |
As far as I remember, the community suggested using specific extensions for each file type. @rosea1 please let us know your thoughts about this. |
Using |
I'm waiting for your point of view about the topic @rosea1 |
Closing this since no response from OP. Feel free to reopen with more info so we can discuss it. |
you will have automatic file name resolution issues with different bundlers if you drop the .js extension on the dist files when importing / exporting.
The text was updated successfully, but these errors were encountered: