Browse Source

perf(tauri.js) build API typedefs on the API compilation process (#861)

Lucas Fernandes Nogueira 5 years ago
parent
commit
0f00384152
3 changed files with 7 additions and 5 deletions
  1. 2 3
      cli/tauri.js/package.json
  2. 1 1
      cli/tauri.js/rollup.config.js
  3. 4 1
      cli/tauri.js/tsconfig.api.json

+ 2 - 3
cli/tauri.js/package.json

@@ -10,11 +10,10 @@
     "url": "https://opencollective.com/tauri"
   },
   "scripts": {
-    "build": "yarn build:api && yarn build:typedefs && yarn build:webpack",
+    "build": "yarn build:api && yarn build:webpack",
     "build:webpack": "rimraf ./dist && yarn build:typevalidators && webpack --progress",
     "build:typevalidators": "node ./build/type-validators",
-    "build:api": "rimraf ./api && rollup -c --silent && yarn build:typedefs",
-    "build:typedefs": "yarn tsc ./api-src/index.ts --declaration --emitDeclarationOnly --outDir api",
+    "build:api": "rimraf ./api && rollup -c --silent",
     "build-release": "yarn build --display none --progress false",
     "test": "jest --runInBand --no-cache --testPathIgnorePatterns=\"(build|dev)\"",
     "pretest": "yarn build",

+ 1 - 1
cli/tauri.js/rollup.config.js

@@ -47,7 +47,7 @@ export default [{
       }
     }),
     typescript({
-      tsconfig: './api-src/tsconfig.json'
+      tsconfig: './tsconfig.api.json'
     }),
     babel({
       configFile: false,

+ 4 - 1
cli/tauri.js/api-src/tsconfig.json → cli/tauri.js/tsconfig.api.json

@@ -7,6 +7,9 @@
     "paths": {
       "types": ["@types"]
     },
+    "declaration": true,
+    "declarationDir": "api",
+    "rootDir": "api-src"
   },
-  "include": ["./"]
+  "include": ["./api-src"]
 }