# vue-jsx-runtime **Repository Path**: mirrors_LancerComet/vue-jsx-runtime ## Basic Information - **Project Name**: vue-jsx-runtime - **Description**: jsx-runtime for vue - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-16 - **Last Updated**: 2026-01-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vue-jsx-runtime [](https://www.npmjs.com/package/vue-jsx-runtime) [](https://github.com/dolymood/vue-jsx-runtime/actions/workflows/test.yml) [](https://codecov.io/github/dolymood/vue-jsx-runtime) Vue 3 jsx runtime support. The background https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html . With new jsx runtime support, which means a JSX ast standard, every lib can have its own jsx syntax with small limits. [Examples](https://github.com/dolymood/vue-jsx-runtime-examples) with TS: - [vite](https://github.com/dolymood/vue-jsx-runtime-examples/tree/main/vite) with esbuild usage - [vue-cli](https://github.com/dolymood/vue-jsx-runtime-examples/tree/main/vue-cli) with babel usage - [swc](https://github.com/dolymood/vue-jsx-runtime-examples/tree/main/swc) TODO: - optimize, transformOn, isCustomElement ... - dev validation - more tests - more features ## Installation Install the plugin with: ```bash pnpm add vue-jsx-runtime # or npm install vue-jsx-runtime ``` ## Usage ### In Babel ```js // babel plugin plugins: [ [ // add @babel/plugin-transform-react-jsx '@babel/plugin-transform-react-jsx', { throwIfNamespace: false, runtime: 'automatic', importSource: 'vue-jsx-runtime' } ], ], ``` ### In TypeScript `tsconfig.json`: ```json { "compilerOptions": { "jsx": "react-jsxdev", /* 'react-jsx' or 'react-jsxdev'. You can also use 'preserve' to use babel or other tools to handle jsx*/ "jsxImportSource": "vue-jsx-runtime" } } ``` If you used with Babel, you need to set the config: ```json { "compilerOptions": { "jsx": "preserve", /* 'react-jsx' or 'react-jsxdev'. You can also use 'preserve' to use babel or other tools to handle jsx*/ } } ``` ### In Other Tools If you use some tool which support jsx-runtime, like [swc](https://swc.rs/), you can use like this: `.swcrc`: ```json { "jsc": { "transform": { "react": { "runtime": "automatic", "importSource": "vue-jsx-runtime" } } } } ``` More details, see https://swc.rs/docs/configuration/compilation#jsctransformreact About [esbuild](https://github.com/evanw/esbuild/), see https://github.com/evanw/esbuild/issues/1172 and a hack way https://github.com/evanw/esbuild/issues/832 . https://github.com/evanw/esbuild/issues/334#issuecomment-711444731 . ## Syntax ### Content Functional component: ```jsx const App = () =>