3.1.0 • Published 5 months ago

@vitejs/plugin-vue-jsx v3.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 months ago

@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

include

Type: (string | RegExp)[] | string | RegExp | null

Default: /\.[jt]sx$/

A picomatch pattern, 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, or array of patterns, which specifies the files to be ignored by the plugin.

See @vue/babel-plugin-jsx 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

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(...)
3.0.2

8 months ago

3.1.0

5 months ago

3.0.1

1 year ago

3.0.0-beta.0

1 year ago

2.1.1

1 year ago

3.0.0-alpha.0

1 year ago

2.1.0

2 years ago

2.1.0-beta.0

2 years ago

3.0.0

1 year ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.0-beta.0

2 years ago

2.0.0-alpha.0

2 years ago

1.3.10

2 years ago

2.0.0-alpha.1

2 years ago

1.3.9

2 years ago

1.3.7

2 years ago

1.3.5

2 years ago

1.3.8

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.3.0-beta.0

2 years ago

1.2.0

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago