Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Generate an importmap tag #3883

Open
SparK-Cruz opened this issue Aug 17, 2024 · 1 comment
Open

[Request] Generate an importmap tag #3883

SparK-Cruz opened this issue Aug 17, 2024 · 1 comment

Comments

@SparK-Cruz
Copy link

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.

@hyrious
Copy link

hyrious commented Aug 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants