From ef0ea3c7fed08ec00070f6dea338e18ed0f6428b Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Tue, 23 Oct 2018 05:12:55 +1100 Subject: [PATCH] More WIP --- js/compiler.ts | 1 - tests/020_json_modules.ts | 2 +- tests/020_json_modules.ts.out | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 tests/020_json_modules.ts.out diff --git a/js/compiler.ts b/js/compiler.ts index baec8b5597fae6..6b54a299e3cb1f 100644 --- a/js/compiler.ts +++ b/js/compiler.ts @@ -423,7 +423,6 @@ export class DenoCompiler if (mediaType === MediaType.Json) { // tslint:disable-next-line:max-line-length moduleMetaData.outputCode = `define([], function() { return JSON.parse(\`${sourceCode}\`); });\n//# sourceURL=${fileName}`; - console.log(moduleMetaData.outputCode); } else { // TypeScript is overly opinionated that only CommonJS modules kinds can // support JSON imports. Allegedly this was fixed in diff --git a/tests/020_json_modules.ts b/tests/020_json_modules.ts index cf650e60f93e76..89963751c034fc 100644 --- a/tests/020_json_modules.ts +++ b/tests/020_json_modules.ts @@ -1,3 +1,3 @@ import * as config from "./subdir/config.json"; -console.log(config); +console.log(JSON.stringify(config)); diff --git a/tests/020_json_modules.ts.out b/tests/020_json_modules.ts.out new file mode 100644 index 00000000000000..5d1623e6b61d13 --- /dev/null +++ b/tests/020_json_modules.ts.out @@ -0,0 +1 @@ +{"foo":{"bar":true,"baz":["qat",1]}}