File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -570,7 +570,7 @@ async function buildEnvironment(
570570 environment : BuildEnvironment ,
571571 server ?: ViteDevServer
572572) : Promise < RolldownOutput | RolldownOutput [ ] /* | RollupWatcher */ > {
573- const { root, packageCache } = environment . config
573+ const { root, packageCache, mode } = environment . config
574574 const options = environment . config . build
575575 const libOptions = options . lib
576576 const { logger } = environment
@@ -803,11 +803,12 @@ async function buildEnvironment(
803803 output . format === 'iife' ||
804804 ( isSsrTargetWebworkerEnvironment &&
805805 ( typeof input === 'string' || Object . keys ( input ) . length === 1 ) ) ,
806- minify :
806+ minify : mode === 'production' ?
807807 options . minify === 'oxc'
808808 ? true
809809 : options . minify === false
810810 ? 'dce-only'
811+ : false
811812 : false ,
812813 ...output ,
813814 }
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export async function resolvePlugins(
5151 normalPlugins : Plugin [ ] ,
5252 postPlugins : Plugin [ ] ,
5353) : Promise < Plugin [ ] > {
54- const isBuild = true
54+ const isBuild = config . command === 'build'
5555 const isWorker = config . isWorker
5656 const buildPlugins = isBuild
5757 ? await ( await import ( '../build' ) ) . resolveBuildPlugins ( config )
You can’t perform that action at this time.
0 commit comments