# vite-plugin-vue2-jsx **Repository Path**: typescript2024/vite-plugin-vue2-jsx ## Basic Information - **Project Name**: vite-plugin-vue2-jsx - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-08-02 - **Last Updated**: 2024-08-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # @vitejs/plugin-vue2-jsx [](https://npmjs.com/package/@vitejs/plugin-vue2-jsx) > [!CAUTION] > Vue 2 has reached EOL, and this project is no longer actively maintained. --- Provides Vue 2 JSX & TSX support with HMR. ```js // vite.config.js import vueJsx from '@vitejs/plugin-vue2-jsx' export default { plugins: [ vueJsx({ // options are passed on to @vue/babel-preset-jsx }) ] } ``` ## Options ### include Type: `(string | RegExp)[] | string | RegExp | null` Default: `/\.[jt]sx$/` A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files the plugin should operate on. ### exclude Type: `(string | RegExp)[] | string | RegExp | null` Default: `undefined` A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files to be ignored by the plugin. > See [@vue/babel-preset-jsx](https://github.com/vuejs/jsx-vue2/tree/dev/packages/babel-preset-jsx#readme) for other options. ## HMR Detection This plugin supports HMR of Vue JSX components. The detection requirements are: - The component must be exported. - The component must be declared by calling `defineComponent` via a root-level statement, either variable declaration or export declaration. ### Supported patterns ```jsx import { defineComponent } from 'vue' // named exports w/ variable declaration: ok export const Foo = defineComponent({}) // named exports referencing variable declaration: ok const Bar = defineComponent({ render() { return