daiwei 7 miesięcy temu
rodzic
commit
37a6e01982
2 zmienionych plików z 22 dodań i 20 usunięć
  1. 2 2
      packages/runtime-vapor/src/dom/prop.ts
  2. 20 18
      rollup.config.js

+ 2 - 2
packages/runtime-vapor/src/dom/prop.ts

@@ -409,7 +409,7 @@ function classHasMismatch(
 
   let hasMismatch: boolean = false
   if (isIncremental) {
-    if (expectedClassSet.size > 0) {
+    if (expected) {
       hasMismatch = Array.from(expectedClassSet).some(
         cls => !actualClassSet.has(cls),
       )
@@ -447,7 +447,7 @@ function styleHasMismatch(
 
   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,

+ 20 - 18
rollup.config.js

@@ -392,24 +392,26 @@ function createMinifiedConfig(/** @type {PackageFormat} */ format) {
       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 }
+        },
+      },
     ],
   )
 }