Skip to content

Commit

Permalink
refactor: use optional chaining in config define of vue-jsx (#8046)
Browse files Browse the repository at this point in the history
  • Loading branch information
ydcjeff committed May 7, 2022
1 parent 20ea999 commit 9f8381e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/plugin-vue-jsx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,15 @@ function vueJsxPlugin(options = {}) {
name: 'vite:vue-jsx',

config(config) {
const optionsApi = config.define
? config.define.__VUE_OPTIONS_API__
: undefined
const devTools = config.define
? config.define.__VUE_PROD_DEVTOOLS__
: undefined
return {
// only apply esbuild to ts files
// since we are handling jsx and tsx now
esbuild: {
include: /\.ts$/
},
define: {
__VUE_OPTIONS_API__: optionsApi != null ? optionsApi : true,
__VUE_PROD_DEVTOOLS__: devTools != null ? devTools : false
__VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
__VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false
}
}
},
Expand Down

0 comments on commit 9f8381e

Please sign in to comment.