TypeScript/tests/cases/compiler/requireOfJsonFile_PathMapping.ts
Sheetal Nandi d36df0dda5
Try file if matched pattern specifies the extension instead of all the time (#42246)
* Test case for path mapping with extension

* Try file if matched pattern specifies the extension instead of all the time
Fixes #39743
2021-01-08 12:03:29 -08:00

25 lines
518 B
TypeScript

// @noImplicitReferences: true
// @traceResolution: true
// @allowJs: true
// @esModuleInterop: true
// @fullEmitPaths: true
// @resolveJsonModule: true
// @Filename: /node_modules/foo/bar/foobar.json
{ "a": 10 }
// @Filename: /a.ts
import foobar from "foo/bar/foobar.json";
// @Filename: /tsconfig.json
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"*": ["node_modules/*", "src/types"]
},
"allowJs": true,
"outDir": "bin"
}
}