-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed as not planned
Description
Clear and concise description of the problem
When authoring a Plugin, it is sometimes desirable to trick ViteDevServer
into thinking that a file is JavaScript even when its extension would normally indicate to Vite otherwise.
For example, it may be desirable to import non-js, non-css files without creating intermediate virtual files with a .js
or .css
extension. In this situation, we would find ourselves fighting against Vite's built-in logic and wanting to do something like the Import Analysis Plugin (like this).
Suggested solution
Export markExplicitImport
and perhaps the corresponding isAbc
functions. This would allow Vite to treat these annotations as internal implementation details instead of the sort of accidental public (to plugins) contract.
Alternative
I didn't come up with any.
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.