guoyunhe / swc-minify-webpack-plugin

A faster minimizer for webpack based on swc.minify()
Apache License 2.0
7 stars 1 forks source link

Published package includes incorrect type declarations #3

Closed sirreal closed 1 year ago

sirreal commented 1 year ago

The type declarations in the published package is export {}. This is incorrect and makes it more difficult to use this package.

This was fixed by #2. Running tsc on 1e03fee111c36abd05646d6b99cc31536b053130 works as expected. The declarations were subsequently broken presumably by changes to the build system and/or changes to the tsconfig.

tsc generates the expected declarations with the following change:

diff --git a/tsconfig.json b/tsconfig.json
index afe540c..2b33d72 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -2,6 +2,8 @@
   "extends": "@tsconfig/node16/tsconfig.json",
   "compilerOptions": {
     "resolveJsonModule": true,
+    "declaration": true,
+    "outDir": "dist",
     "types": [
       "node",
       "jest",

But the new build system continues to generate the wrong declaration file.

guoyunhe commented 1 year ago

1.1.2 should fix this.

sirreal commented 1 year ago

Fixed in v2, thank you.