@@ -46,6 +46,12 @@ const pkg = require(resolve(`package.json`))
46
46
const packageOptions = pkg . buildOptions || { }
47
47
const name = packageOptions . filename || path . basename ( packageDir )
48
48
49
+ const banner = `/**
50
+ * ${ pkg . name } v${ masterVersion }
51
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
52
+ * @license MIT
53
+ **/`
54
+
49
55
const [ enumPlugin , enumDefines ] = inlineEnums ( )
50
56
51
57
/** @type {Record<PackageFormat, OutputOptions> } */
@@ -136,11 +142,7 @@ function createConfig(format, output, plugins = []) {
136
142
( isGlobalBuild || isBrowserESMBuild || isBundlerESMBuild ) &&
137
143
! packageOptions . enableNonBrowserBranches
138
144
139
- output . banner = `/**
140
- * ${ pkg . name } v${ masterVersion }
141
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
142
- * @license MIT
143
- **/`
145
+ output . banner = banner
144
146
145
147
output . exports = isCompatPackage ? 'auto' : 'named'
146
148
if ( isCJSBuild ) {
@@ -372,24 +374,21 @@ function createMinifiedConfig(/** @type {PackageFormat} */ format) {
372
374
{
373
375
name : 'swc-minify' ,
374
376
375
- async renderChunk (
376
- contents ,
377
- _ ,
378
- { format, sourcemap, sourcemapExcludeSources } ,
379
- ) {
380
- const { code, map } = await minifySwc ( contents , {
377
+ async renderChunk ( contents , _ , { format } ) {
378
+ const { code } = await minifySwc ( contents , {
381
379
module : format === 'es' ,
380
+ format : {
381
+ comments : false ,
382
+ } ,
382
383
compress : {
383
384
ecma : 2016 ,
384
385
pure_getters : true ,
385
386
} ,
386
387
safari10 : true ,
387
388
mangle : true ,
388
- sourceMap : ! ! sourcemap ,
389
- inlineSourcesContent : ! sourcemapExcludeSources ,
390
389
} )
391
390
392
- return { code, map : map || null }
391
+ return { code : banner + code , map : null }
393
392
} ,
394
393
} ,
395
394
] ,
0 commit comments