Skip to content

Commit e8be039

Browse files
authored
Add banner support for UMD builds and adjust SWC comment handling (#7639) (#7646)
1 parent 0b5a174 commit e8be039

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

utils/rollup-build-target.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ function buildTarget({ moduleFormat, buildType, bundleState, input = 'src/index.
210210
swcPlugin({ swc: swcOptions(isDebug, isUMD, isMin) })
211211
],
212212
output: {
213+
banner: isUMD ? getBanner(BANNER[buildType]) : undefined,
213214
plugins: getOutPlugins(),
214215
file: `${dir}/${OUT_PREFIX[buildType]}${isUMD ? '.js' : '.mjs'}`
215216
},

utils/rollup-swc-options.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function swcOptions(isDebug, isUMD, minify) {
1616
target: isUMD ? 'es5' : 'es2022',
1717
minify: {
1818
format: {
19-
comments: !isDebug || minify ? false : 'all'
19+
comments: !isDebug || minify ? 'some' : 'all'
2020
},
2121
mangle: minify,
2222
compress: (!isDebug && minify) ? {

0 commit comments

Comments
 (0)