Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2abcc7c

Browse files
committed
fix: properly interpret boolean values indefine
refvitejs/vite-plugin-vue@46d3d65
1 parent1dcfff6 commit2abcc7c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎src/core/index.ts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,22 +274,32 @@ export const plugin: UnpluginInstance<Options | undefined, false> =
274274
},
275275

276276
config(config){
277+
constparseDefine=(v:unknown)=>{
278+
try{
279+
returntypeofv==='string' ?JSON.parse(v) :v
280+
}catch{
281+
returnv
282+
}
283+
}
284+
277285
return{
278286
resolve:{
279287
dedupe:config.build?.ssr ?[] :['vue'],
280288
},
281289
define:{
282290
__VUE_OPTIONS_API__:
283291
options.value.features?.optionsAPI??
284-
config.define?.__VUE_OPTIONS_API__??
292+
parseDefine(config.define?.__VUE_OPTIONS_API__)??
285293
true,
286294
__VUE_PROD_DEVTOOLS__:
287295
(options.value.features?.prodDevtools||
288-
config.define?.__VUE_PROD_DEVTOOLS__)??
296+
parseDefine(config.define?.__VUE_PROD_DEVTOOLS__))??
289297
false,
290298
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:
291299
(options.value.features?.prodHydrationMismatchDetails||
292-
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__)??
300+
parseDefine(
301+
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__,
302+
))??
293303
false,
294304
},
295305
ssr:{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp