You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin tries to write both rollup outputs to the same destination index.modern.js. This results in a file that is a mixture of CJS and ESM, an invalid syntax that causes errors.
It seems this is because the plugin holds a single mutable filename reference in state.configuredFileName
Not familiar with writing rollup plugins but I find it strange that options.file is null in generateBundle but not in outputOptions. It seems difficult to lookup the original configured file value for each output in the generateBundle phase. The only unique data I can see is the options.format. I can't remember if rollup lets you define multiple outputs with the same format, but for now I will just pretend each format is a unique output so I can look up the file name from a Map.
Given this rollup configuration:
This plugin tries to write both rollup outputs to the same destination
index.modern.js
. This results in a file that is a mixture of CJS and ESM, an invalid syntax that causes errors.It seems this is because the plugin holds a single mutable filename reference in
state.configuredFileName
rollup-plugin-web-worker-loader/src/index.js
Lines 37 to 46 in 48df453
This mutable value is used as the output destination, which is unstable.
rollup-plugin-web-worker-loader/src/plugin/outputOptions.js
Lines 3 to 12 in 48df453
I will try to make a PR fix.
The text was updated successfully, but these errors were encountered: