Is is possible to use custom syntax in TSX files with a custom plugin? #14495
Closed
Description
Description
Attempting build a plugin. Need to do the following: https://stackblitz.com/edit/vitejs-vite-tsvarv?file=myPlugin.mjs,myFile.tsx,main.js,vite.config.js&terminal=dev
The problems:
- It throws an error about the syntax in the
.tsx
file. I think it eagerly parses it beforetransform
. Disabling esbuild gives an output, but there is still an error in the logs about the syntax. - Is there a way to disable this eager parse?
- Is there a way to prefix certain imported
.tsx
files to be processed by thetransform-file
transformer plugin?
Suggested solution
If a plugin needs to overwrite builtin syntax, maybe it could export overrideBuiltin(id): boolean
?
Alternative
No response
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.