unplugin-vue-jsx provides seamless integration of JSX syntax into Vue 3 projects across a multitude of build tools, including Vite, Rollup, esbuild, Webpack, Rolldown, and Rspack. It leverages the unplugin ecosystem to offer a single plugin API compatible with various bundlers, simplifying configuration. The package is currently stable at version 0.8.1, with a release cadence that has seen multiple minor and patch updates in recent months, addressing bug fixes and introducing breaking changes, particularly around Node.js version support and Vue compatibility. A key differentiator is its broad bundler support and focus on Vue 3's JSX transformation, internalizing Babel for robust syntax parsing and transformation. It is primarily used as a development dependency to enable `.jsx` and `.tsx` file processing.
npm install unplugin-vue-jsxVerified import paths — ran on the pinned version, not inferred.
Shows how to configure unplugin-vue-jsx with Vite for a basic Vue 3 project, enabling JSX support for components. Includes commented JSX example.
Upgrade your project to Vue 3 or pin `unplugin-vue-jsx` to a version prior to 0.7.0 (e.g., `~0.6.x`).
Update your Node.js environment to version 20.19.0 or higher. Check your project's `engines` field in `package.json`.
Migrate your build configuration files (e.g., `vite.config.js`, `rollup.config.js`) to use ES module syntax (`import`/`export`). Ensure your project's `package.json` uses `"type": "module"` or uses `.mjs` extensions for config files.
Manually add `typescript` to `parserOpts.plugins` in the plugin configuration if you are using `.tsx` files, for example: `VueJsx({ parserOpts: { plugins: ['jsx', 'typescript'] } })`.Adjust the `exclude` option in the plugin configuration to explicitly include paths you wish to transform, e.g., `exclude: [/node_modules\/(?!your-linked-package)/]` or set `exclude: []` to disable exclusion entirely.
Upgrade your project's build setup to Webpack 5+ or migrate away from Vue CLI 4 to a newer build system like Vite.
Update your configuration files to use ES Module `import` syntax. Ensure your project is set up for ESM, potentially by adding `"type": "module"` to `package.json` or using `.mjs` file extensions.
Ensure your project is using Vue 3. If you must use Vue 2, downgrade `unplugin-vue-jsx` to a version less than 0.7.0, e.g., `npm i -D unplugin-vue-jsx@^0.6.0`.
Explicitly configure the `parserOpts` in the plugin options to include the `typescript` plugin: `VueJsx({ parserOpts: { plugins: ['jsx', 'typescript'] } })`.Upgrade your Node.js installation to version 20.19.0 or newer.
No dependency data recorded yet.