Skip to content

Commit

Permalink
fix: do not apply jsxInject on ts files
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 20, 2021
1 parent a3c334f commit a72a59c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/esbuild.ts
Expand Up @@ -115,7 +115,7 @@ export function esbuildPlugin(options: ESBuildOptions = {}): Plugin {
this.warn(prettifyMessage(m, code))
})
}
if (options.jsxInject) {
if (options.jsxInject && /\.(?:j|t)sx\b/.test(id)) {
result.code = options.jsxInject + ';' + result.code
}
return {
Expand Down

0 comments on commit a72a59c

Please sign in to comment.