Repository navigation
transformMixedEsModules not working for mixed ESM/CommonJS modules #1882
Replies: 1 comment
|
Reproduced on @rollup/plugin-commonjs 29.0.3 with your The file you have is the problem here. Options, best first:
|
|
Reproduced on @rollup/plugin-commonjs 29.0.3 with your The file you have is the problem here. Options, best first:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone, I'm having some confusion when using the rollup plugin commonjs.
In my application, some third-party packages in node_modules use CommonJS syntax. By default, I use @rollup/plugin-commonjs to handle this code, and it works as expected.
However, when some modules have mixed ESM and CommonJS usage, it seems the commonjs plugin doesn't achieve the expected effect, even though I've already set the
transformMixedEsModulesparameter, but it still doesn't work.For example, with this config file:
The content of index.js is quite simple:
The final output bundle.esm.js still contains CommonJS statements:
I'm not sure if I'm using it wrong somewhere? Or how should I properly use it?
All reactions