unplugin / unplugin-vue-jsx

Vue JSX plugin for both Vue 2 and 3. Support Rollup, Vite, esbuild, Webpack, and more.
MIT License
28 stars 1 forks source link

Can not use empty options for plugin #43

Closed tmg0 closed 8 months ago

tmg0 commented 8 months ago

Describe the bug

Cannot use it as described in the documentation like:

// esbuild.config.js
import { build } from 'esbuild'

build({
  plugins: [require('unplugin-vue-jsx/esbuild')()],
})

And I have to provide a empty object {} as the option:

plugins: [require('unplugin-vue-jsx/esbuild')({})],

I found that userOptions has a default value, so if it's possible to support the empty options?

Reproduction

https://stackblitz.com/edit/stackblitz-starters-7or5g1?file=tsup.config.ts

System Info

System:
    OS: macOS 14.2
    CPU: (8) arm64 Apple M2
    Memory: 44.58 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.1 - ~/.volta/tools/image/node/18.19.1/bin/node
    npm: 10.2.4 - ~/.volta/tools/image/node/18.19.1/bin/npm
    pnpm: 8.15.4 - ~/.volta/tools/image/pnpm/8.15.4/bin/pnpm
  Browsers:
    Chrome: 122.0.6261.129
    Safari: 17.2

Used Package Manager

pnpm

Validations

stackblitz[bot] commented 8 months ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.