Browse Source

6.6-2: using baseUrl to locate non-relative paths.

Frederic G. MARAND 5 years ago
parent
commit
ed88dacaff
4 changed files with 5 additions and 3 deletions
  1. 0 0
      app/modules/person.ts
  2. 1 1
      app/player.ts
  3. 2 1
      app/tsconfig.json
  4. 2 1
      package.json

+ 0 - 0
app/person.ts → app/modules/person.ts


+ 1 - 1
app/player.ts

@@ -1,4 +1,4 @@
-import {Person} from "./person";
+import {Person} from "person";
 
 export class Player implements Person {
   age: number;

+ 2 - 1
app/tsconfig.json

@@ -7,7 +7,8 @@
     // module: commonjs -> moduleResolution: node, just make it explicit
     "moduleResolution": "node",
     // Debug helper
-    "traceResolution": true
+    // "traceResolution": true
+    "baseUrl": "./modules"
   },
   "files": [
     "app.ts"

+ 2 - 1
package.json

@@ -12,7 +12,8 @@
   "scripts": {
     "clean": "rm -fr js/* all/*.js",
     "compile": "rm -fr js/* && cd app && npx tsc",
-    "start": "http-server"
+    "start": "http-server",
+    "watch": "rm -fr js/* && cd app && npx tsc --watch"
   },
   "version": "2.0.0"
 }