Skip to content

Commit

Permalink
fix(plugin-vue): default value for compile time flags (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 authored Jan 7, 2025
1 parent 5d39582 commit ae9d948
Show file tree
Hide file tree
Showing 2 changed files with 28 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 @@ -242,18 +242,18 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
dedupe: config.build?.ssr ? [] : ['vue'],
},
define: {
__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__
),
__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,
},
ssr: {
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ae9d948

Please sign in to comment.