@vitejs/plugin-vue-jsx
Provides Vue 3 JSX & TSX support with HMR.
Last updated 2 months ago by GitHub Actions .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @vitejs/plugin-vue-jsx 
SYNC missed versions from official npm registry.

@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.

defineComponentName

Type: string[]

Default: ['defineComponent']

The name of the function to be used for defining components. This is useful when you have a custom defineComponent function.

tsTransform

Type: 'babel' | 'built-in'

Default: 'babel'

Defines how typescript transformation is handled for .tsx files.

'babel' - typescript transformation is handled by @babel/plugin-transform-typescript during babel invocation for JSX transformation.

'built-in' - babel is invoked only for JSX transformation and then typescript transformation is handled by the same toolchain used for .ts files (currently esbuild).

babelPlugins

Type: any[]

Default: undefined

Provide additional plugins for babel invocation for JSX transformation.

tsPluginOptions

Type: any

Default: undefined

Defines options for @babel/plugin-transform-typescript plugin.

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 or the name specified in defineComponentName 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(...)

Current Tags

  • 3.0.0-alpha.0                                ...           alpha (3 years ago)
  • 5.0.0-beta.0                                ...           beta (10 months ago)
  • 5.1.4                                ...           latest (2 months ago)

53 Versions

  • 5.1.4                                ...           2 months ago
  • 5.1.3                                ...           4 months ago
  • 5.1.2                                ...           5 months ago
  • 5.1.1                                ...           7 months ago
  • 5.1.0                                ...           8 months ago
  • 5.0.1                                ...           9 months ago
  • 5.0.0                                ...           10 months ago
  • 5.0.0-beta.0                                ...           10 months ago
  • 4.2.0                                ...           a year ago
  • 4.1.2                                ...           a year ago
  • 4.1.1                                ...           a year ago
  • 4.1.0                                ...           a year ago
  • 4.0.1                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 3.0.0-beta.0                                ...           3 years ago
  • 3.0.0-alpha.0                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.1.0-beta.0                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 2.0.0-beta.0                                ...           4 years ago
  • 2.0.0-alpha.1                                ...           4 years ago
  • 2.0.0-alpha.0                                ...           4 years ago
  • 1.3.10                                ...           4 years ago
  • 1.3.9                                ...           4 years ago
  • 1.3.8                                ...           4 years ago
  • 1.3.7                                ...           4 years ago
  • 1.3.5                                ...           4 years ago
  • 1.3.4                                ...           4 years ago
  • 1.3.3                                ...           4 years ago
  • 1.3.2                                ...           4 years ago
  • 1.3.1                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.3.0-beta.0                                ...           4 years ago
  • 1.2.0                                ...           5 years ago
  • 1.1.8                                ...           5 years ago
  • 1.1.7                                ...           5 years ago
  • 1.1.6                                ...           5 years ago
  • 1.1.5                                ...           5 years ago
  • 1.1.4                                ...           5 years ago
  • 1.1.3                                ...           5 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.3                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Downloads
Today 0
This Week 12
This Month 18
Last Day 5
Last Week 14
Last Month 134
Dev Dependencies (2)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |