Static asset imports could play nicer with other tools #18369
aaronadamsCA
started this conversation in
Feedback
Replies: 1 comment
-
Yeah, we are exploring utilizing import attributes. The current blockers for us are:
It might take a bit long. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Today I'm importing a lot of static assets like this:
Because of the
?raw
search parameter, tools like TypeScript and ESLint don't actually understand these imports, so I lose a lot of conveniences: autocompleting imports, highlighting invalid ones, automatically updating when target files are renamed, Cmd + click to open source files, etc. etc.I'd love to see a new syntax that uses import attributes, which I'm assuming would give me back all of those conveniences. Maybe it could look similar to how
import.meta.glob
already works, e.g.:Sorry if there's an existing discussion about this, but I can't find a thing so far.
Beta Was this translation helpful? Give feedback.
All reactions