File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,8 @@ export async function resolvePlugins(
159159 : oxcPlugin ( config )
160160 : null ,
161161 enableNativePlugin === true
162- ? nativeJsonPlugin ( { ...config . json , minify : isBuild } )
163- : jsonPlugin ( config . json , isBuild ) ,
162+ ? nativeJsonPlugin ( { ...config . json , minify : config . isProduction } )
163+ : jsonPlugin ( config . json , config . isProduction ) ,
164164 enableNativePlugin === true ? nativeWasmHelperPlugin ( ) : wasmHelperPlugin ( ) ,
165165 webWorkerPlugin ( config ) ,
166166 assetPlugin ( config ) ,
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const isJSONRequest = (request: string): boolean =>
3939
4040export function jsonPlugin (
4141 options : Required < JsonOptions > ,
42- isBuild : boolean ,
42+ minify : boolean ,
4343) : Plugin {
4444 const plugin = {
4545 name : 'vite:json' ,
@@ -98,7 +98,7 @@ export function jsonPlugin(
9898 ) {
9999 // during build, parse then double-stringify to remove all
100100 // unnecessary whitespaces to reduce bundle size.
101- if ( isBuild ) {
101+ if ( minify ) {
102102 json = JSON . stringify ( JSON . parse ( json ) )
103103 }
104104
You can’t perform that action at this time.
0 commit comments