(/** @type {PackageFormat} */ format)
| 360 | } |
| 361 | |
| 362 | function createMinifiedConfig(/** @type {PackageFormat} */ format) { |
| 363 | return createConfig( |
| 364 | format, |
| 365 | { |
| 366 | file: outputConfigs[format].file.replace(/\.js$/, '.prod.js'), |
| 367 | format: outputConfigs[format].format, |
| 368 | }, |
| 369 | [ |
| 370 | { |
| 371 | name: 'swc-minify', |
| 372 | |
| 373 | async renderChunk(contents, _, { format }) { |
| 374 | const { code } = await minifySwc(contents, { |
| 375 | module: format === 'es', |
| 376 | format: { |
| 377 | comments: false, |
| 378 | }, |
| 379 | compress: { |
| 380 | ecma: 2016, |
| 381 | pure_getters: true, |
| 382 | }, |
| 383 | safari10: true, |
| 384 | mangle: true, |
| 385 | }) |
| 386 | |
| 387 | return { code: banner + code, map: null } |
| 388 | }, |
| 389 | }, |
| 390 | ], |
| 391 | ) |
| 392 | } |
no test coverage detected