Replies: 1 comment
-
https://www.npmjs.com/package/vite-plugin-lang-jsx this package worked for me |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My project has been developed for almost 4 years,there are thounds of .js files which contain jsx syntax.It used Webpack as building tool,now I want to use Vite instead.But encounter this error:
Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
When I search solutions for this issue, there seems two way:
1.replace .js to .jsx.
2.use <script lang='jsx'>.
but all of them don't meet my command.I just have to use .js as suffix.Anyone has any solution?
Beta Was this translation helpful? Give feedback.
All reactions