|
| 1 | +/a/lib/tsc.js -w |
| 2 | +//// [/user/username/projects/myproject/a.ts] |
| 3 | +import * as data from './data.json' |
| 4 | + |
| 5 | +//// [/user/username/projects/myproject/data.json] |
| 6 | +{ "foo": 1 } |
| 7 | + |
| 8 | +//// [/user/username/projects/myproject/tsconfig.json] |
| 9 | +{"compilerOptions":{"moduleResolution":"node"}} |
| 10 | + |
| 11 | +//// [/a/lib/lib.d.ts] |
| 12 | +/// <reference no-default-lib="true"/> |
| 13 | +interface Boolean {} |
| 14 | +interface Function {} |
| 15 | +interface CallableFunction {} |
| 16 | +interface NewableFunction {} |
| 17 | +interface IArguments {} |
| 18 | +interface Number { toExponential: any; } |
| 19 | +interface Object {} |
| 20 | +interface RegExp {} |
| 21 | +interface String { charAt: any; } |
| 22 | +interface Array<T> { length: number; [n: number]: T; } |
| 23 | + |
| 24 | +//// [/user/username/projects/myproject/a.js] |
| 25 | +"use strict"; |
| 26 | +exports.__esModule = true; |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +Output:: |
| 31 | +>> Screen clear |
| 32 | +12:00:23 AM - Starting compilation in watch mode... |
| 33 | + |
| 34 | + |
| 35 | +a.ts(1,23): error TS2732: Cannot find module './data.json'. Consider using '--resolveJsonModule' to import module with '.json' extension |
| 36 | + |
| 37 | + |
| 38 | +12:00:26 AM - Found 1 error. Watching for file changes. |
| 39 | + |
| 40 | + |
| 41 | +Program root files: ["/user/username/projects/myproject/a.ts"] |
| 42 | +Program options: {"moduleResolution":2,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} |
| 43 | +Program files:: |
| 44 | +/a/lib/lib.d.ts |
| 45 | +/user/username/projects/myproject/a.ts |
| 46 | + |
| 47 | +Semantic diagnostics in builder refreshed for:: |
| 48 | +/a/lib/lib.d.ts |
| 49 | +/user/username/projects/myproject/a.ts |
| 50 | + |
| 51 | +WatchedFiles:: |
| 52 | +/user/username/projects/myproject/tsconfig.json: |
| 53 | + {"pollingInterval":250} |
| 54 | +/user/username/projects/myproject/a.ts: |
| 55 | + {"pollingInterval":250} |
| 56 | +/a/lib/lib.d.ts: |
| 57 | + {"pollingInterval":250} |
| 58 | + |
| 59 | +FsWatches:: |
| 60 | +/user/username/projects/myproject: |
| 61 | + {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} |
| 62 | + |
| 63 | +FsWatchesRecursive:: |
| 64 | +/user/username/projects/myproject/data.json: |
| 65 | + {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} |
| 66 | +/user/username/projects/myproject/node_modules/@types: |
| 67 | + {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} |
| 68 | +/user/username/projects/myproject: |
| 69 | + {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} |
| 70 | + |
| 71 | +exitCode:: ExitStatus.undefined |
| 72 | + |
| 73 | +Change:: Enable resolveJsonModule |
| 74 | + |
| 75 | +//// [/user/username/projects/myproject/tsconfig.json] |
| 76 | +{"compilerOptions":{"moduleResolution":"node","resolveJsonModule":true}} |
| 77 | + |
| 78 | +//// [/user/username/projects/myproject/a.js] file written with same contents |
| 79 | + |
| 80 | +Output:: |
| 81 | +>> Screen clear |
| 82 | +12:00:30 AM - File change detected. Starting incremental compilation... |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +12:00:34 AM - Found 0 errors. Watching for file changes. |
| 87 | + |
| 88 | + |
| 89 | +Program root files: ["/user/username/projects/myproject/a.ts"] |
| 90 | +Program options: {"moduleResolution":2,"resolveJsonModule":true,"watch":true,"configFilePath":"/user/username/projects/myproject/tsconfig.json"} |
| 91 | +Program files:: |
| 92 | +/a/lib/lib.d.ts |
| 93 | +/user/username/projects/myproject/data.json |
| 94 | +/user/username/projects/myproject/a.ts |
| 95 | + |
| 96 | +Semantic diagnostics in builder refreshed for:: |
| 97 | +/a/lib/lib.d.ts |
| 98 | +/user/username/projects/myproject/data.json |
| 99 | +/user/username/projects/myproject/a.ts |
| 100 | + |
| 101 | +WatchedFiles:: |
| 102 | +/user/username/projects/myproject/tsconfig.json: |
| 103 | + {"pollingInterval":250} |
| 104 | +/user/username/projects/myproject/a.ts: |
| 105 | + {"pollingInterval":250} |
| 106 | +/a/lib/lib.d.ts: |
| 107 | + {"pollingInterval":250} |
| 108 | +/user/username/projects/myproject/data.json: |
| 109 | + {"pollingInterval":250} |
| 110 | + |
| 111 | +FsWatches:: |
| 112 | +/user/username/projects/myproject: |
| 113 | + {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} |
| 114 | + |
| 115 | +FsWatchesRecursive:: |
| 116 | +/user/username/projects/myproject: |
| 117 | + {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} |
| 118 | +/user/username/projects/myproject/data.json: |
| 119 | + {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} |
| 120 | +/user/username/projects/myproject/node_modules/@types: |
| 121 | + {"fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}} |
| 122 | + |
| 123 | +exitCode:: ExitStatus.undefined |
0 commit comments