Skip to content

Commit fb6b5a8

Browse files
authored
feat: preserve build.rolldownOptions.output (#289)
1 parent 1101100 commit fb6b5a8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

packages/vite-plugin-monkey/src/node/plugins/buildBundle.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,18 @@ export const buildBundleFactory = (
260260
rolldownOptions: {
261261
external: Object.keys(option.globalsPkg2VarName),
262262
output: {
263+
// set some default values which may be overridden by custom viteConfig
264+
comments: false,
265+
strict: false, // rolldown will add 'use strict' to the file top instead of the wrapper function next line
266+
intro: `'use strict'`,
267+
268+
// preserve output options set in viteConfig, allow overriding values set above
269+
...viteConfig.build.rolldownOptions.output,
263270
// disable rolldown minify when using terser or esbuild, see #280
264271
...(rolldownMinify !== undefined
265272
? { minify: rolldownMinify }
266273
: {}),
267274
globals: option.globalsPkg2VarName,
268-
comments: false,
269-
strict: false, // rolldown will add 'use strict' to the file top instead of the wrapper function next line
270-
intro: `'use strict'`,
271275
},
272276
experimental: {
273277
attachDebugInfo: 'none',

0 commit comments

Comments
 (0)