File tree Expand file tree Collapse file tree
packages/vite-plugin-monkey/src/node/plugins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,25 +242,29 @@ export const buildBundleFactory = (
242242 ( await getSystemjsTexts ( ) ) . join ( '\n' ) + '\n' + finalJsCode ;
243243 }
244244 } else {
245+ const rolldownMinify =
246+ ( viteConfig . build . minify === undefined ||
247+ viteConfig . build . minify === 'oxc' ) &&
248+ ! Array . isArray ( viteConfig . build . rolldownOptions ?. output )
249+ ? viteConfig . build . rolldownOptions . output ?. minify
250+ : undefined ;
245251 // use vite(rolldown) build iife
246252 const buildResult = ( await build ( {
247253 logLevel : 'error' ,
248254 configFile : false ,
249255 build : {
250256 write : false ,
251257 minify,
258+ terserOptions : viteConfig . build . terserOptions ,
252259 target : 'esnext' ,
253260 modulePreload : false ,
254261 rolldownOptions : {
255262 external : Object . keys ( option . globalsPkg2VarName ) ,
256263 output : {
257- minify : minify
258- ? {
259- mangle : false ,
260- compress : false ,
261- codegen : true ,
262- }
263- : undefined ,
264+ // disable rolldown minify when using terser or esbuild, see #280
265+ ...( rolldownMinify !== undefined
266+ ? { minify : rolldownMinify }
267+ : { } ) ,
264268 globals : option . globalsPkg2VarName ,
265269 comments : false ,
266270 strict : false , // rolldown will add 'use strict' to the file top instead of the wrapper function next line
You can’t perform that action at this time.
0 commit comments