-
-
Couldn't load subscription status.
- Fork 7.4k
Closed
Description
In React development case it is a common habit to use .js file instead of .jsx for JSX component.
Vite seems simply skips the esbuild plugin if the file name does not match this Regex:
vite/src/node/esbuildService.ts
Line 9 in e24133e
| export const tjsxRE = /\.(tsx?|jsx)$/ |
vite/src/node/server/serverPluginEsbuild.ts
Lines 22 to 29 in e24133e
| if ( | |
| !tjsxRE.test(ctx.path) || | |
| !ctx.body || | |
| ctx.type === 'text/html' || | |
| resolver.isPublicRequest(ctx.path) | |
| ) { | |
| return | |
| } |
which means only .ts, .tsx and .jsx files would have the opportunity to be transpiled by esbuild.
How about adding an option to also transpile .js file with esbuild? It would be great for React developers.
Ginhing, monsterjacob24, amcsi and mijamo
Metadata
Metadata
Assignees
Labels
No labels