1Input:: 2//// [/lib/lib.d.ts] 3/// <reference no-default-lib="true"/> 4interface Boolean {} 5interface Function {} 6interface CallableFunction {} 7interface NewableFunction {} 8interface IArguments {} 9interface Number { toExponential: any; } 10interface Object {} 11interface RegExp {} 12interface String { charAt: any; } 13interface Array<T> { length: number; [n: number]: T; } 14interface ReadonlyArray<T> {} 15declare const console: { log(msg: any): void; }; 16 17//// [/src/src/hello.json] 18{ 19 "hello": "world" 20} 21 22//// [/src/src/index.ts] 23import hello from "./hello.json" 24 25export default hello.hello 26 27//// [/src/tsconfig_withFiles.json] 28{ 29 "compilerOptions": { 30 "composite": true, "sourceMap": true, 31 "moduleResolution": "node", 32 "module": "commonjs", 33 "resolveJsonModule": true, 34 "esModuleInterop": true, 35 "allowSyntheticDefaultImports": true, 36 "outDir": "dist", 37 "skipDefaultLibCheck": true 38 }, 39 "files": [ 40 "src/index.ts", "src/hello.json" 41 ] 42} 43 44//// [/src/tsconfig_withInclude.json] 45{ 46 "compilerOptions": { 47 "composite": true, 48 "moduleResolution": "node", 49 "module": "commonjs", 50 "resolveJsonModule": true, 51 "esModuleInterop": true, 52 "allowSyntheticDefaultImports": true, 53 "outDir": "dist", 54 "skipDefaultLibCheck": true 55 }, 56 "include": [ 57 "src/**/*" 58 ] 59} 60 61//// [/src/tsconfig_withIncludeAndFiles.json] 62{ 63 "compilerOptions": { 64 "composite": true, 65 "moduleResolution": "node", 66 "module": "commonjs", 67 "resolveJsonModule": true, 68 "esModuleInterop": true, 69 "allowSyntheticDefaultImports": true, 70 "outDir": "dist", 71 "skipDefaultLibCheck": true 72 }, 73 "files": [ 74 "src/hello.json" 75 ], 76 "include": [ 77 "src/**/*" 78 ] 79} 80 81//// [/src/tsconfig_withIncludeOfJson.json] 82{ 83 "compilerOptions": { 84 "composite": true, 85 "moduleResolution": "node", 86 "module": "commonjs", 87 "resolveJsonModule": true, 88 "esModuleInterop": true, 89 "allowSyntheticDefaultImports": true, 90 "outDir": "dist", 91 "skipDefaultLibCheck": true 92 }, 93 "include": [ 94 "src/**/*", "src/**/*.json" 95 ] 96} 97 98 99 100Output:: 101/lib/tsc --b src/tsconfig_withFiles.json --verbose --explainFiles 102[[90m12:00:07 AM[0m] Projects in this build: 103 * src/tsconfig_withFiles.json 104 105[[90m12:00:08 AM[0m] Project 'src/tsconfig_withFiles.json' is out of date because output file 'src/dist/tsconfig_withFiles.tsbuildinfo' does not exist 106 107[[90m12:00:09 AM[0m] Building project '/src/tsconfig_withFiles.json'... 108 109lib/lib.d.ts 110 Default library for target 'es3' 111src/src/hello.json 112 Imported via "./hello.json" from file 'src/src/index.ts' 113 Part of 'files' list in tsconfig.json 114src/src/index.ts 115 Part of 'files' list in tsconfig.json 116exitCode:: ExitStatus.Success 117 118 119//// [/src/dist/src/hello.json] 120{ 121 "hello": "world" 122} 123 124 125//// [/src/dist/src/index.d.ts] 126declare const _default: string; 127export default _default; 128 129 130//// [/src/dist/src/index.js] 131"use strict"; 132var __importDefault = (this && this.__importDefault) || function (mod) { 133 return (mod && mod.__esModule) ? mod : { "default": mod }; 134}; 135exports.__esModule = true; 136var hello_json_1 = __importDefault(require("./hello.json")); 137exports["default"] = hello_json_1["default"].hello; 138//# sourceMappingURL=index.js.map 139 140//// [/src/dist/src/index.js.map] 141{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;AAAA,4DAAgC;AAEhC,qBAAe,uBAAK,CAAC,KAAK,CAAA"} 142 143//// [/src/dist/tsconfig_withFiles.tsbuildinfo] 144{"program":{"fileNames":["../../lib/lib.d.ts","../src/hello.json","../src/index.ts"],"fileInfos":[{"version":"3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"6651571919-{\n \"hello\": \"world\"\n}",{"version":"-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello","signature":"-1680156224-declare const _default: string;\r\nexport default _default;\r\n"}],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":true,"module":1,"outDir":"./","skipDefaultLibCheck":true,"sourceMap":true},"fileIdsList":[[2]],"referencedMap":[[3,1]],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./src/index.d.ts"},"version":"FakeTSVersion"} 145 146//// [/src/dist/tsconfig_withFiles.tsbuildinfo.readable.baseline.txt] 147{ 148 "program": { 149 "fileNames": [ 150 "../../lib/lib.d.ts", 151 "../src/hello.json", 152 "../src/index.ts" 153 ], 154 "fileNamesList": [ 155 [ 156 "../src/hello.json" 157 ] 158 ], 159 "fileInfos": { 160 "../../lib/lib.d.ts": { 161 "version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", 162 "signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", 163 "affectsGlobalScope": true 164 }, 165 "../src/hello.json": { 166 "version": "6651571919-{\n \"hello\": \"world\"\n}", 167 "signature": "6651571919-{\n \"hello\": \"world\"\n}" 168 }, 169 "../src/index.ts": { 170 "version": "-27703454282-import hello from \"./hello.json\"\n\nexport default hello.hello", 171 "signature": "-1680156224-declare const _default: string;\r\nexport default _default;\r\n" 172 } 173 }, 174 "options": { 175 "allowSyntheticDefaultImports": true, 176 "composite": true, 177 "esModuleInterop": true, 178 "module": 1, 179 "outDir": "./", 180 "skipDefaultLibCheck": true, 181 "sourceMap": true 182 }, 183 "referencedMap": { 184 "../src/index.ts": [ 185 "../src/hello.json" 186 ] 187 }, 188 "exportedModulesMap": {}, 189 "semanticDiagnosticsPerFile": [ 190 "../../lib/lib.d.ts", 191 "../src/hello.json", 192 "../src/index.ts" 193 ], 194 "latestChangedDtsFile": "./src/index.d.ts" 195 }, 196 "version": "FakeTSVersion", 197 "size": 1133 198} 199 200 201 202Change:: no-change-run 203Input:: 204 205 206Output:: 207/lib/tsc --b src/tsconfig_withFiles.json --verbose --explainFiles 208[[90m12:00:19 AM[0m] Projects in this build: 209 * src/tsconfig_withFiles.json 210 211[[90m12:00:20 AM[0m] Project 'src/tsconfig_withFiles.json' is up to date because newest input 'src/src/index.ts' is older than output 'src/dist/tsconfig_withFiles.tsbuildinfo' 212 213exitCode:: ExitStatus.Success 214 215 216