Przeglądaj źródła

build: use webpack to build declaration file

NateScarlet 5 lat temu
rodzic
commit
88965c49c6
4 zmienionych plików z 7 dodań i 4 usunięć
  1. 1 1
      package.json
  2. 5 3
      tsconfig.json
  3. 0 0
      types/index.d.ts
  4. 1 0
      webpack.config.js

+ 1 - 1
package.json

@@ -17,7 +17,7 @@
   "dependencies": {
     "diff-match-patch": "^1.0.4"
   },
-  "types": "src/ts/types/index.d.ts",
+  "types": "dist/index.d.ts",
   "devDependencies": {
     "@babel/core": "^7.8.7",
     "@babel/preset-env": "^7.8.7",

+ 5 - 3
tsconfig.json

@@ -7,16 +7,18 @@
     "noUnusedLocals": true,
     "lib": [
       "dom",
-      "es2015"
+      "ESNext"
     ],
     "moduleResolution": "node",
     "esModuleInterop": true,
     "typeRoots": [
       "./node_modules/@types"
-    ]
+    ],
+    "types": ["./types"],
+    "declaration": true
   },
   "include": [
-    "src"
+    "src", "types/types.d.ts"
   ],
   "exclude": [
     "node_modules"

+ 0 - 0
src/ts/types/index.d.ts → types/index.d.ts


+ 1 - 0
webpack.config.js

@@ -103,6 +103,7 @@ module.exports = [
       new CopyPlugin([
         {from: 'src/images', to: 'images'},
         {from: 'src/js', to: 'js'},
+        {from: 'types', to: 'types'},
       ]),
     ],
   }, {