Closed frank-dspeed closed 3 years ago
Isn't this covered by being able to load particular modules types https://bundlers.tooling.report/importing-modules/ and being able to output particular module types https://bundlers.tooling.report/output-module-formats/?
@jakearchibald i would say it is not well covered but your right it is maybe to hard to cover that in detail. i need to create a tool for that to inspect packages.
create ESModules out of diffrent formarts so that you end up in a clean ESM Build.
I am at present focused on ESM Adoption and i found out that there are not much tools that can take a legacy code base into a current useable ESModule 98% of all packages do not even support running in ESM under NodeJS.
So the basline test should be take a CJS&TS code base using also webpack and get a working ESM Version out of it
at present i am working on Porting next.js to diffrent Engines and there i saw hugh problems to package the code base i needed to do a lot of tricks and hacks as they code for webpack and not for a platform.
Current State
To run Modules at present inside diffrent environments you need to shim the complet environment that the code was build for if you could manage it to get clean ESM versions from that code you could easy Reuse it and extend it while you need a lot of logic if your bound to CJS&WEBPACK as both are not the most ReuseAble Formarts.