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 @@ -104,7 +104,7 @@ export async function resolvePlugins(
104
104
cssPlugin ( config ) ,
105
105
esbuildBannerFooterCompatPlugin ( config ) ,
106
106
config . oxc !== false ? oxcPlugin ( config ) : null ,
107
- jsonPlugin ( config . json , config . isProduction , enableNativePlugin === true ) ,
107
+ jsonPlugin ( config . json , isBuild , enableNativePlugin === true ) ,
108
108
wasmHelperPlugin ( config ) ,
109
109
webWorkerPlugin ( config ) ,
110
110
assetPlugin ( config ) ,
Original file line number Diff line number Diff line change @@ -40,11 +40,11 @@ export const isJSONRequest = (request: string): boolean =>
40
40
41
41
export function jsonPlugin (
42
42
options : Required < JsonOptions > ,
43
- minify : boolean ,
43
+ isBuild : boolean ,
44
44
enableNativePlugin : boolean ,
45
45
) : Plugin {
46
46
if ( enableNativePlugin ) {
47
- return nativeJsonPlugin ( { ...options , minify } )
47
+ return nativeJsonPlugin ( { ...options , minify : isBuild } )
48
48
}
49
49
50
50
return {
@@ -104,7 +104,7 @@ export function jsonPlugin(
104
104
) {
105
105
// during build, parse then double-stringify to remove all
106
106
// unnecessary whitespaces to reduce bundle size.
107
- if ( minify ) {
107
+ if ( isBuild ) {
108
108
json = JSON . stringify ( JSON . parse ( json ) )
109
109
}
110
110
You can’t perform that action at this time.
0 commit comments