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
Output cjs chunk lost __esModule
for es module.
#3760
Comments
So as I understand it, the issue is that auto-generated chunks do not have an
So it looks like the However I would wonder if there isn't a better to handle this than either mashing |
Yeah, that can be work fine as expected.But i think the cjs module output from es module should have |
Not sure. What you want is that the return value of a dynamic import has the |
Ok, it appears that Webpack is actually going all the way, adding BOTH |
Thanks for your explanation :) |
Please check out #3764 |
Thanks for your quickly fix, it worked by expected. |
Hi @lukastaegert I've been following this issue closely, as well as your related PR that was merged for the commonjs plugin (rollup/plugins#552). No matter how i configure the plugin, it still seems like the output remains unchanged from before. Am I missing something? Did the change to the plugin actually resolve this issue or is there a reason that this issue is still open? |
It should be resolved and this issues closed |
As @tbgse said, the issues is also happend. @lukastaegert can you re-have a look with this? |
I am not sure how to verify this with the reproduction above, especially I am not 100% sure where to look as I cannot find the code snippet listed above anywhere in the output. So what the fix does NOT do: Inject the __esModule marker into the exporting chunk (unless it is an entry, in which case it should already happen). What it does instead is inject the __esModule marker at the import site by injecting a helper Further guidance would be appreciated especially to what the error is. Also you might want to update the repro with the latest released version of the plugin. |
Ah, what it does not do in fact is inject the |
Yes.It worked fine by add |
Awesome! Depending on feedback by @guybedford I will see this is released soon. Sorry for the wait! |
Input
Output
Original issues: vitejs/vite#764
The input is a chunk, not a entry.Maybe we should change this line to
(this.facadeModule !== null)
.I'm not sure for this, hope get some help,thanks.https://github.com/rollup/rollup/blob/master/src/Chunk.ts#L714-L716
Expected Behavior
Output cjs chunk should hsa
__esModule
for es module. Has codeObject.defineProperty(exports, '__esModule', { value: true });
Actual Behavior
Output cjs chunk lost
__esModule
for es module.The text was updated successfully, but these errors were encountered: