Skip to content

Commit

Permalink
fix(plugin-vue): default value for __VUE_OPTIONS_API__
Browse files Browse the repository at this point in the history
closes #438
  • Loading branch information
sxzz committed Aug 29, 2024
1 parent ac12559 commit acb57c9
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions packages/plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,18 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
dedupe: config.build?.ssr ? [] : ['vue'],
},
define: {
__VUE_OPTIONS_API__:
(options.value.features?.optionsAPI ||
config.define?.__VUE_OPTIONS_API__) ??
true,
__VUE_PROD_DEVTOOLS__:
(options.value.features?.prodDevtools ||
config.define?.__VUE_PROD_DEVTOOLS__) ??
false,
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:
(options.value.features?.prodHydrationMismatchDetails ||
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__) ??
false,
__VUE_OPTIONS_API__: !!(
(options.value.features?.optionsAPI ?? true) ||
config.define?.__VUE_OPTIONS_API__
),
__VUE_PROD_DEVTOOLS__: !!(
options.value.features?.prodDevtools ||
config.define?.__VUE_PROD_DEVTOOLS__
),
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: !!(
options.value.features?.prodHydrationMismatchDetails ||
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
),
},
ssr: {
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
Expand Down

0 comments on commit acb57c9

Please sign in to comment.