Socket
Socket
Sign inDemoInstall

@vitejs/plugin-vue-jsx

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-vue-jsx - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

13

CHANGELOG.md

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

6

index.js

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

2

package.json
{
"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(...)
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc