Skip to content

Commit

Permalink
fix: respect command line minify and outDir options
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 7, 2023
1 parent 49bcc25 commit 22047f3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/node/build/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ export async function bundle(
...options,
emptyOutDir: true,
ssr,
outDir: ssr ? config.tempDir : config.outDir,
// minify with esbuild in MPA mode (for CSS)
minify: ssr
? config.mpa
? 'esbuild'
: false
: typeof options.minify === 'boolean'
? options.minify
: !process.env.DEBUG,
outDir: ssr ? config.tempDir : options.outDir || config.outDir,
cssCodeSplit: false,
rollupOptions: {
...rollupOptions,
Expand Down Expand Up @@ -107,9 +115,7 @@ export async function bundle(
}
})
}
},
// minify with esbuild in MPA mode (for CSS)
minify: ssr ? (config.mpa ? 'esbuild' : false) : !process.env.DEBUG
}
}
})

Expand Down

0 comments on commit 22047f3

Please sign in to comment.