esbuild icon indicating copy to clipboard operation
esbuild copied to clipboard

[Request] Generate an importmap tag

Open SparK-Cruz opened this issue 1 year ago • 1 comments

Basically if something is going to import files dynamically (like lazy loading a module) the imports are not replaced on those. For those cases the import of npm libraries will fail. Generating an importmap type script tag with a list of bundled modules all pointing to the bundled files in public folders fixes the issue.

SparK-Cruz avatar Aug 17 '24 13:08 SparK-Cruz

I'm not sure what esbuild need to do here. Can you provide a minimal showcase about how did you use esbuild and what you expect to happen?

If you externalizes some modules and want esbuild to generate an importmap that resolves the module to bundled file, like "react": "/public/bundled-react.js". It is impossible since esbuild doesn't know this extra information as it even doesn't bundle the externalized module, neither does it know the bundled file name.

hyrious avatar Aug 17 '24 13:08 hyrious