Skip to content

Is is possible to use custom syntax in TSX files with a custom plugin? #14495

Closed
@kaleidawave

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 before transform. 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 the transform-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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions