TypeScript/tests/cases/compiler/requireOfJsonFile_PathMapping.ts

25 lines
518 B
TypeScript
Raw Normal View History

// @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"
}
}