-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Description
TypeScript Version: 2.9.1 and 3.0.0-dev.20180531
Search Terms:
JSON
resolveJsonModule
sourceMap
Code
A JSON file at "src/test.json":
{
"value": 42
}
Both resolveJsonModule
and sourceMap
enabled within a tsconfig.json
file at ./
:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"esModuleInterop": true,
"resolveJsonModule": true,
"outDir": "./out",
"lib": [
"es2016"
],
"sourceMap": true,
"rootDir": "src",
},
"include": [
"src/**/*.ts"
]
}
A TypeScript file at ./src/main.ts
that utilizes this JSON file:
import test from "./test.json";
console.log(test.value);
Expected behavior:
- The outputted JSON file at
./out/test.json
should have the following contents:
{
"value": 42
}
- The source map file at
./out/test.json.map
should not exist.
Actual behavior:
- The outputted file at
./out/test.json
has a comment indicating the source map at the bottom:
{
"value": 42
}
//# sourceMappingURL=test.json.map
- The source map file at
./out/test.json.map
exists.
Playground Link: N/A.
smakazmi
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript