Nocturnal Programmer's Machine

    @vitejs/plugin-vue-jsx
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.8 • Public • Published

    @vitejs/plugin-vue-jsx npm

    Provides Vue 3 JSX & TSX support with HMR.

    // vite.config.js
    import vueJsx from '@vitejs/plugin-vue-jsx'
    
    export default {
      plugins: [
        vueJsx({
          // options are passed on to @vue/babel-plugin-jsx
        })
      ]
    }

    Options

    See @vue/babel-plugin-jsx.

    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

    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 <div>Test</div> }})
    export { Bar }
    
    // default export call: ok
    export default defineComponent({ render() { return <div>Test</div> }})
    
    // default export referencing variable declaration: ok
    const Baz = defineComponent({ render() { return <div>Test</div> }})
    export default Baz

    Non-supported patterns

    // not using `defineComponent` call
    export const Bar = { ... }
    
    // not exported
    const Foo = defineComponent(...)

    Keywords

    none

    Install

    npm i @vitejs/plugin-vue-jsx

    DownloadsWeekly Downloads

    7,756

    Version

    1.1.8

    License

    MIT

    Unpacked Size

    16.8 kB

    Total Files

    7

    Last publish

    Collaborators

    • yyx990803
    • patak
    • antfu