-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feature request: Import type / types in Metadata.outputs[*].imports[*] #655
Comments
Thanks for filing this. I've considered including this in the past. This is why the imports are objects instead of strings (so I can add additional properties). I was mainly just waiting for a use case. So I can add this. |
Actually it looks like dynamic imports are already not included in the list of imports for an output chunk. This is a bug that should be fixed, but for now it should give you what you need. Can you confirm that dynamic imports in chunks are omitted for you too? |
@evanw, you know what? You're probably right and I never even noticed. This actually suits my use-case quite well because I'm only interested in generating I hope that if / when this 'bug' is fixed, we'll also have the ability to filter on sync vs async chunk dependencies. |
That bug hasn't been fixed yet but in the next release you'll be able to filter by |
Use-case
Reading the build metadata of a code-split front-end and generating
<link rel="modulepreload" />
tags for synchronous imports (or at least prioritizing such over dynamic imports).Challenge
The challenge I've seen is understanding the type of imports surfaced in
Metadata
. I would like to be able to traverse the chunk dependency graph and generate appropriate preloads but would like to exclude dynamic imports from these. The metadata produced byesbuild
doesn't include enough information to make the distinction between dynamic and synchronous imports.The text was updated successfully, but these errors were encountered: