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(
159
159
: oxcPlugin ( config )
160
160
: null ,
161
161
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 ) ,
164
164
enableNativePlugin === true ? nativeWasmHelperPlugin ( ) : wasmHelperPlugin ( ) ,
165
165
webWorkerPlugin ( config ) ,
166
166
assetPlugin ( config ) ,
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export const isJSONRequest = (request: string): boolean =>
39
39
40
40
export function jsonPlugin (
41
41
options : Required < JsonOptions > ,
42
- isBuild : boolean ,
42
+ minify : boolean ,
43
43
) : Plugin {
44
44
const plugin = {
45
45
name : 'vite:json' ,
@@ -98,7 +98,7 @@ export function jsonPlugin(
98
98
) {
99
99
// during build, parse then double-stringify to remove all
100
100
// unnecessary whitespaces to reduce bundle size.
101
- if ( isBuild ) {
101
+ if ( minify ) {
102
102
json = JSON . stringify ( JSON . parse ( json ) )
103
103
}
104
104
You can’t perform that action at this time.
0 commit comments