@vitejs/plugin-vue-jsx
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,14 @@ | ||
## [1.0.1](https://github.com/vitejs/vite/compare/plugin-vue-jsx@1.0.0...plugin-vue-jsx@1.0.1) (2021-01-04) | ||
### Bug Fixes | ||
* still let esbuild handle ts ([5903554](https://github.com/vitejs/vite/commit/59035546db7ff4b7020242ba994a5395aac92802)) | ||
# 2.0.0-beta.4 (2021-01-04) | ||
# 1.0.0 (2021-01-04) | ||
@@ -2,0 +15,0 @@ |
@@ -19,3 +19,7 @@ // @ts-check | ||
return { | ||
esbuild: false, | ||
// only apply esbuild to ts files | ||
// since we are handling jsx and tsx now | ||
esbuild: { | ||
include: /\.ts$/ | ||
}, | ||
define: { | ||
@@ -22,0 +26,0 @@ __VUE_OPTIONS_API__: true, |
{ | ||
"name": "@vitejs/plugin-vue-jsx", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Evan You", |
# @vitejs/plugin-vue-jsx | ||
Provides optimized Vue 3 JSX support via [@vue/babel-plugin-jsx](https://github.com/vuejs/jsx-next). | ||
Provides Vue 3 JSX & TSX support with HMR. | ||
@@ -10,6 +10,48 @@ ```js | ||
export default { | ||
plugins: [vueJsx({ | ||
// options are passed on to @vue/babel-plugin-jsx | ||
})] | ||
plugins: [ | ||
vueJsx({ | ||
// options are passed on to @vue/babel-plugin-jsx | ||
}) | ||
] | ||
} | ||
``` | ||
## Options | ||
See [@vue/babel-plugin-jsx](https://github.com/vuejs/jsx-next). | ||
## 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 vairable declaration: ok | ||
const Bar = defineComponent(...) | ||
export { Bar } | ||
// default export call: ok | ||
export default defineComponent(...) | ||
// default export referencing variable declaration: ok | ||
const Baz = defineComponent(...) | ||
export default Baz | ||
``` | ||
### Non-supported patterns | ||
```jsx | ||
// not using `defineComponent` call | ||
export const Bar = { ... } | ||
// not exported | ||
const Foo = defineComponent(...) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9758
195
56