Skip to content

Commit

Permalink
Fix JSON Modules (denoland#1514)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk authored and ry committed Jan 14, 2019
1 parent de9c67a commit 7d08db2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions js/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export class Compiler
private readonly _options: ts.CompilerOptions = {
allowJs: true,
checkJs: true,
esModuleInterop: true,
module: ts.ModuleKind.ESNext,
outDir: "$deno$",
resolveJsonModule: true,
Expand Down
1 change: 1 addition & 0 deletions js/compiler_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ test(function compilerGetCompilationSettings() {
const expectedKeys = [
"allowJs",
"checkJs",
"esModuleInterop",
"module",
"outDir",
"resolveJsonModule",
Expand Down
5 changes: 2 additions & 3 deletions tests/020_json_modules.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import * as config from "./subdir/config.json";
// TODO Shouldn't need 'default'
console.log(JSON.stringify(config["default"]));
import config from "./subdir/config.json";
console.log(JSON.stringify(config));

0 comments on commit 7d08db2

Please sign in to comment.