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 @@ -102,7 +102,7 @@ export async function resolvePlugins(
102102 cssPlugin ( config ) ,
103103 esbuildBannerFooterCompatPlugin ( config ) ,
104104 config . oxc !== false ? oxcPlugin ( config ) : null ,
105- jsonPlugin ( config . json , config . isProduction , enableNativePlugin === true ) ,
105+ jsonPlugin ( config . json , isBuild , enableNativePlugin === true ) ,
106106 wasmHelperPlugin ( config ) ,
107107 webWorkerPlugin ( config ) ,
108108 assetPlugin ( config ) ,
Original file line number Diff line number Diff line change @@ -40,11 +40,11 @@ export const isJSONRequest = (request: string): boolean =>
4040
4141export function jsonPlugin (
4242 options : Required < JsonOptions > ,
43- minify : boolean ,
43+ isBuild : boolean ,
4444 enableNativePlugin : boolean ,
4545) : Plugin {
4646 if ( enableNativePlugin ) {
47- return nativeJsonPlugin ( { ...options , minify } )
47+ return nativeJsonPlugin ( { ...options , minify : isBuild } )
4848 }
4949
5050 const plugin = {
@@ -104,7 +104,7 @@ export function jsonPlugin(
104104 ) {
105105 // during build, parse then double-stringify to remove all
106106 // unnecessary whitespaces to reduce bundle size.
107- if ( minify ) {
107+ if ( isBuild ) {
108108 json = JSON . stringify ( JSON . parse ( json ) )
109109 }
110110
You can’t perform that action at this time.
0 commit comments