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
Is there a way to generate code which is compatible with ES5?
Currently the code generated by the plugin uses require to link http(s), vm, etc. even when module output is explicitly enabled (output.module, experiments.outputModule, output.libraryTarget, output.chunkFormat, etc.). I believe that it is not a correct behaviour, as require is not available in the module context.
On top of that, the plugin also uses exports, __dirname and similar globals, which is also problematic.
The reason that modules support is needed is that new Nuxt 3 uses modules output format and our company is interested in integrating Nuxt and Module Federation.
I am willing to work on adding this feature to the plugin if my help is needed.
The text was updated successfully, but these errors were encountered:
Thank you for your answer, and by the way, I managed to solve it using unjs/mlly which shims the commonjs specifics in es modules.
But it would be very nice to see it work out of the box without the need to inject this hack to the generated code 😃
Is there a way to generate code which is compatible with ES5?
Currently the code generated by the plugin uses
require
to linkhttp(s)
,vm
, etc. even when module output is explicitly enabled (output.module
,experiments.outputModule
,output.libraryTarget
,output.chunkFormat
, etc.). I believe that it is not a correct behaviour, asrequire
is not available in the module context.On top of that, the plugin also uses
exports
,__dirname
and similar globals, which is also problematic.The reason that modules support is needed is that new Nuxt 3 uses modules output format and our company is interested in integrating Nuxt and Module Federation.
I am willing to work on adding this feature to the plugin if my help is needed.
The text was updated successfully, but these errors were encountered: