Closed max-preuschen closed 1 year ago
Adding <script lang="jsx">
and changing webpack.config.to
{
test: /\.js|.jsx$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
plugins: ['@vue/babel-plugin-jsx']
}
}
}
fixes the issue.
Description
I'm using Webpack 5 with Vue 3 and want JSX support, but I'm getting an error during the build process. The project configuration includes the necessary dependencies (
@babel/core
,@vue/babel-plugin-jsx
, etc.) and the Babel loader is configured with the appropriate plugin. However, the build process fails with the following error message:Steps to Reproduce
@babel/core
,@vue/babel-plugin-jsx
, etc.) in the project'spackage.json
file.webpack.config.js
file to enable JSX transformation.Expected Behavior
The build process should successfully compile the Vue 3 project with JSX support and generate the output files without any errors.
Actual Behavior
The build process fails with the aforementioned error message related to the experimental syntax and the required parser plugin(s) for JSX.
Configuration
Additional Information
package.json
webpack.config.js
app.vue
Also created a ticket here: https://github.com/vuejs/babel-plugin-jsx/issues/641