let hasMismatch: boolean = false
if (isIncremental) {
- if (expectedClassSet.size > 0) {
+ if (expected) {
hasMismatch = Array.from(expectedClassSet).some(
cls => !actualClassSet.has(cls),
)
let hasMismatch: boolean = false
if (isIncremental) {
- if (expectedStyleMap.size > 0) {
+ if (expected) {
// check if the expected styles are present in the actual styles
hasMismatch = Array.from(expectedStyleMap.entries()).some(
([key, val]) => actualStyleMap.get(key) !== val,
file: outputConfigs[format].file.replace(/\.js$/, '.prod.js'),
},
[
- // {
- // name: 'swc-minify',
- // async renderChunk(contents, _, { format }) {
- // const { code } = await minifySwc(contents, {
- // module: format === 'es',
- // format: {
- // comments: false,
- // },
- // compress: {
- // ecma: 2016,
- // pure_getters: true,
- // },
- // safari10: true,
- // mangle: true,
- // })
- // return { code: banner + code, map: null }
- // },
- // },
+ {
+ name: 'swc-minify',
+
+ async renderChunk(contents, _, { format }) {
+ const { code } = await minifySwc(contents, {
+ module: format === 'es',
+ format: {
+ comments: false,
+ },
+ compress: {
+ ecma: 2016,
+ pure_getters: true,
+ },
+ safari10: true,
+ mangle: true,
+ })
+
+ return { code: banner + code, map: null }
+ },
+ },
],
)
}