{"componentChunkName":"component---gatsby-theme-teklog-src-templates-post-tsx","path":"/prodding-typescript/esm-default-import-json-file","result":{"data":{"site":{"siteMetadata":{"siteUrl":"https://blog.tekmi.nl","author":{"name":"Teklog","avatar":"/img/tekmi-icon.svg"}}},"blogPost":{"frontmatter":{"title":"Importing JSON file using ES Modules","slug":"prodding-typescript/esm-default-import-json-file","series":"prodding-typescript","date":"2020-06-18","datePretty":"18 June, 2020","coverImage":{"childImageSharp":{"fixed":{"base64":"data:image/jpeg;base64,/9j/2wBDABALDA4MChAODQ4SERATGCgaGBYWGDEjJR0oOjM9PDkzODdASFxOQERXRTc4UG1RV19iZ2hnPk1xeXBkeFxlZ2P/2wBDARESEhgVGC8aGi9jQjhCY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2P/wgARCAANABQDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAAAAQCA//EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/aAAwDAQACEAMQAAABh7ZrERFn/8QAGxABAAICAwAAAAAAAAAAAAAAAgEDACIREhP/2gAIAQEAAQUCrPaIqRXq4yudBtiXC//EABURAQEAAAAAAAAAAAAAAAAAAAAR/9oACAEDAQE/AVf/xAAWEQEBAQAAAAAAAAAAAAAAAAAAEWH/2gAIAQIBAT8Bqa//xAAbEAADAAIDAAAAAAAAAAAAAAAAARESIjJxof/aAAgBAQAGPwJ7RouSpz8OijP/xAAbEAADAAMBAQAAAAAAAAAAAAAAAREhMVFhkf/aAAgBAQABPyFE3AgiTJqFTVLxCLWusZE2fCAjeen/2gAMAwEAAgADAAAAEJs//8QAFxEBAQEBAAAAAAAAAAAAAAAAAQARQf/aAAgBAwEBPxAxlHL/xAAXEQEBAQEAAAAAAAAAAAAAAAABEQAh/9oACAECAQE/EC2Gp7n/xAAfEAEAAgIABwAAAAAAAAAAAAABABEhMUFRYZGh0fD/2gAIAQEAAT8QVRVQrY+vtA41wWs+D3He20gOkRyXAcATVQwEAFAOebuA8q7YzjP/2Q==","width":1000,"height":625,"src":"/static/3f202a2571735e617a6fa63ab52e3fdb/a7715/ProddingTypeScript_ImportJson.jpg","srcSet":"/static/3f202a2571735e617a6fa63ab52e3fdb/a7715/ProddingTypeScript_ImportJson.jpg 1x"}}},"author":"Adam","authorAvatar":null},"timeToRead":6,"excerpt":"To prod I wanted to import a JSON file using ES Modules default import syntax inside my TypeScript application, but... Prerequisites NodeJS Long Time…","html":"<h2 id=\"to-prod\" style=\"position:relative;\"><a href=\"#to-prod\" aria-label=\"to prod permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>To prod</h2>\n<p>I wanted to import a JSON file using ES Modules default import syntax inside my TypeScript application, but...</p>\n<h2 id=\"prerequisites\" style=\"position:relative;\"><a href=\"#prerequisites\" aria-label=\"prerequisites permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Prerequisites</h2>\n<ul>\n<li>NodeJS Long Time Support (Version 12.x)</li>\n<li>NodeJS Package Manager (Version 6.x)</li>\n<li>TypeScript (Version 3.9.x)</li>\n<li>\n<p>The <strong>settings.json</strong> file with the valid JSON content:</p>\n<div class=\"gatsby-highlight\" data-language=\"json\"><pre class=\"language-json\"><code class=\"language-json\"><span class=\"token punctuation\">{</span>\n  <span class=\"token property\">\"env\"</span><span class=\"token operator\">:</span> <span class=\"token string\">\"production\"</span>\n<span class=\"token punctuation\">}</span></code></pre></div>\n</li>\n</ul>\n<h2 id=\"tldr\" style=\"position:relative;\"><a href=\"#tldr\" aria-label=\"tldr permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>TL;DR</h2>\n<ul>\n<li>\n<p>Solution </p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">tsc --resolveJsonModule --esModuleInterop JSONReader.ts</code></pre></div>\n</li>\n<li>Repository: <a href=\"https://github.com/tekmi/prodding-typescript/tree/master/esm-default-import-json-file\">https://github.com/tekmi/prodding-typescript/tree/master/esm-default-import-json-file</a></li>\n</ul>\n<h2 id=\"life-without-typescript\" style=\"position:relative;\"><a href=\"#life-without-typescript\" aria-label=\"life without typescript permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Life without TypeScript</h2>\n<p>ES Modules (ESM), next to other module systems (i.e.: AMD, UMD, and CommonJS), are yet another way of bringing modularity to JavaScript. </p>\n<ul>\n<li>ESM are not natively supported by <a href=\"https://caniuse.com/#feat=es6-module\">all Web Browsers</a> yet, nor by the NodeJS 12.x Engine (unless via <a href=\"https://medium.com/@nodejs/announcing-a-new-experimental-modules-1be8d2d6c2ff\">--experimental-modules</a> flag). </li>\n<li>Because ESM have been standardized by <a href=\"https://www.ecma-international.org/default.htm\">Ecma International</a> under <a href=\"https://tc39.es/ecma262/#sec-modules\">ECMA-262 JavaScript Language Specification</a>, they should eventually become a preferred, go-to solution. </li>\n<li>Even NodeJS Engine, which has been favoring and using CommonJS modules for years, has finally brought ES Modules to <a href=\"https://medium.com/@nodejs/announcing-core-node-js-support-for-ecmascript-modules-c5d6dc29b663\">NodeJS 13.2.0 Version</a> in November 2019.</li>\n</ul>\n<p>Although we can already declare <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules#Applying_the_module_to_your_HTML\">script as module</a> in modern browsers,\nwe still cannot forget about the almighty module bundlers that allowed bundling JavaScript modules into a single JavaScript file from the very beginning. Nowadays <a href=\"https://webpack.js.org/guides/installation/\">Webpack</a> and <a href=\"https://parceljs.org/getting_started.html\">Parcel</a> are dominating the space.</p>\n<ul>\n<li>Both of them offer to import JSON files via ES Modules out of the box, so please read the <a href=\"https://parceljs.org/json.html\">Parcel Guide to JSON</a> and <a href=\"https://webpack.js.org/concepts/#loaders\">Webpack Guide to Loaders</a> to learn more.</li>\n<li>We won't go here into the details on how to set Webpack and Parcel, but please check the accompanying repository for quick examples: <a href=\"https://github.com/tekmi/prodding-typescript/tree/master/esm-default-import-json-file/parcel\">Reading JSON file with Parcel</a> and <a href=\"https://github.com/tekmi/prodding-typescript/tree/master/esm-default-import-json-file/webpack\">Reading JSON file with Webpack</a>.</li>\n</ul>\n<p>NodeJS, on the other hand, has embraced modularity from its beginning thanks to the CommonJS syntax. Nevertheless, being able to eventually replace CommonJS with ES Modules and work with one module system only is fascinating.</p>\n<p>With that, let's check together whether TypeScript has any tricks up its sleeve to handle ES Modules more gracefully.</p>\n<h2 id=\"embracing-typescript\" style=\"position:relative;\"><a href=\"#embracing-typescript\" aria-label=\"embracing typescript permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Embracing TypeScript</h2>\n<p>Generally speaking, TypeScript is mostly concerned about typechecking, leaving the topics of modularity and bundling to other tools like Webpack, Packer, SystemJS, or AMD.\nHowever, by treating any file with a top-level <em>import</em> or <em>export</em> as a module, it usually does not stand in our way when we try to use ES Modules syntax.</p>\n<p>Furthermore, depending on the combination of <code class=\"language-text\">--target</code>, <code class=\"language-text\">--module</code>, and <code class=\"language-text\">--moduleResolution</code> flags, TypeScript Compiler knows how to generate appropriate code for CommonJS, AMD, UMD, SystemJS, or ES Modules systems.</p>\n<p>Is it going to protest when we try to import a JSON file using ES Modules default import syntax or let it go?\nLet's verify it by creating a simple file <strong>JSONReader.ts</strong> with the following content.</p>\n<div class=\"gatsby-highlight\" data-language=\"typescript\"><pre class=\"language-typescript\"><code class=\"language-typescript\"><span class=\"token keyword\">import</span> settings <span class=\"token keyword\">from</span> <span class=\"token string\">\"./settings.json\"</span><span class=\"token punctuation\">;</span>\n\n<span class=\"token builtin\">console</span><span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>settings<span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>As soon as we compile it with <code class=\"language-text\">tsc JSONReader.ts</code>, we will instantly see the following error:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">JSONReader.ts:1:22 - error TS2732: Cannot <span class=\"token function\">find</span> module <span class=\"token string\">'./settings.json'</span><span class=\"token builtin class-name\">.</span> Consider using <span class=\"token string\">'--resolveJsonModule'</span> to <span class=\"token function\">import</span> module with <span class=\"token string\">'.json'</span> extension</code></pre></div>\n<p>Because TypeScript Compiler does not tolerate importing JSON files like that out of the box, let's try to get to the bottom of this issue by exploring the possible solutions together.</p>\n<h2 id=\"solution-area\" style=\"position:relative;\"><a href=\"#solution-area\" aria-label=\"solution area permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Solution Area</h2>\n<p>By shouting with the <em>TS2732</em> error code, the TypeScript Compiler also gave us a decent hint, suggesting to use the <code class=\"language-text\">--resolveJsonModule</code> compiler flag. </p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">tsc --resolveJsonModule JSONReader.ts</code></pre></div>\n<p>Unfortunately, this advice was not enough. We have immediately come across another error, as shown below.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">error TS1259: Module <span class=\"token string\">'\"~/prodding-typescript/esm-default-import-json-file/settings\"'</span> can only be default-imported using the <span class=\"token string\">'esModuleInterop'</span> flag</code></pre></div>\n<p>By default, even if the TypeScript Compiler reports a compilation error, it can still emit corresponding JavaScript files (in our case, this is <strong>JSONReader.js</strong> file).\nIf we try to run it via NodeJS Interpreter like <code class=\"language-text\">node JSONReader.js</code>, we will get the following error:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">~/prodding-typescript/esm-default-import-json-file/JSONReader.js:4\nconsole.log<span class=\"token punctuation\">(</span>settings_json_1<span class=\"token punctuation\">[</span><span class=\"token string\">\"default\"</span><span class=\"token punctuation\">]</span>.env<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\n                                       ^\n\nTypeError: Cannot <span class=\"token builtin class-name\">read</span> property <span class=\"token string\">'env'</span> of undefined</code></pre></div>\n<p>By looking into the content of the <strong>JSONReader.js</strong> file (presented below), we see that TypeScript Compiler not only has converted ES Modules syntax to CommonJS, but also created an additional <em>default</em> namespace which has caused the above <em>TypeError</em>. </p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token string\">\"use strict\"</span><span class=\"token punctuation\">;</span>\nexports<span class=\"token punctuation\">.</span>__esModule <span class=\"token operator\">=</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">var</span> settings_json_1 <span class=\"token operator\">=</span> <span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"./settings.json\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\nconsole<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>settings_json_1<span class=\"token punctuation\">[</span><span class=\"token string\">\"default\"</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>To fix it, let's follow yet another advice from TypeScript Compiler, this time regarding the <code class=\"language-text\">--esModuleInterop</code> compiler flag.</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">tsc --resolveJsonModule --esModuleInterop JSONReader.ts</code></pre></div>\n<p>Or to be even more specific, because <code class=\"language-text\">--esModuleInterop</code> and <code class=\"language-text\">--allowSyntheticDefaultImports</code> are closely related to each other, we could run it like so:</p>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\">tsc --resolveJsonModule --esModuleInterop --allowSyntheticDefaultImports <span class=\"token boolean\">true</span> JSONReader.ts </code></pre></div>\n<p>After that, all the TypeScript Compiler's errors are gone. If we run the re-generated JavaScript file with <code class=\"language-text\">node JSONReader.js</code> now, we should see the correct <code class=\"language-text\">production</code> text in the console. </p>\n<p>When we examine this file again (presented below), we should spot a new <code class=\"language-text\">__importDefault</code> helper function that enables interoperability between CommonJS and ES Modules via the creation of namespace objects for all imports.</p>\n<div class=\"gatsby-highlight\" data-language=\"javascript\"><pre class=\"language-javascript\"><code class=\"language-javascript\"><span class=\"token string\">\"use strict\"</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">var</span> __importDefault <span class=\"token operator\">=</span> <span class=\"token punctuation\">(</span><span class=\"token keyword\">this</span> <span class=\"token operator\">&amp;&amp;</span> <span class=\"token keyword\">this</span><span class=\"token punctuation\">.</span>__importDefault<span class=\"token punctuation\">)</span> <span class=\"token operator\">||</span> <span class=\"token keyword\">function</span> <span class=\"token punctuation\">(</span><span class=\"token parameter\">mod</span><span class=\"token punctuation\">)</span> <span class=\"token punctuation\">{</span>\n    <span class=\"token keyword\">return</span> <span class=\"token punctuation\">(</span>mod <span class=\"token operator\">&amp;&amp;</span> mod<span class=\"token punctuation\">.</span>__esModule<span class=\"token punctuation\">)</span> <span class=\"token operator\">?</span> mod <span class=\"token operator\">:</span> <span class=\"token punctuation\">{</span> <span class=\"token string\">\"default\"</span><span class=\"token operator\">:</span> mod <span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\n<span class=\"token punctuation\">}</span><span class=\"token punctuation\">;</span>\nexports<span class=\"token punctuation\">.</span>__esModule <span class=\"token operator\">=</span> <span class=\"token boolean\">true</span><span class=\"token punctuation\">;</span>\n<span class=\"token keyword\">var</span> settings_json_1 <span class=\"token operator\">=</span> <span class=\"token function\">__importDefault</span><span class=\"token punctuation\">(</span><span class=\"token function\">require</span><span class=\"token punctuation\">(</span><span class=\"token string\">\"./settings.json\"</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span>\nconsole<span class=\"token punctuation\">.</span><span class=\"token function\">log</span><span class=\"token punctuation\">(</span>settings_json_1<span class=\"token punctuation\">[</span><span class=\"token string\">\"default\"</span><span class=\"token punctuation\">]</span><span class=\"token punctuation\">.</span>env<span class=\"token punctuation\">)</span><span class=\"token punctuation\">;</span></code></pre></div>\n<p>That's all there is to it. Before we wrap it up, let's clarify a few things:</p>\n<ul>\n<li><code class=\"language-text\">--resolveJsonModule</code> has been introduced in <a href=\"https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#new---resolvejsonmodule\">TypeScript 2.9</a> and is <em>false</em> by default.\nThis requires the developers to opt-in for this behavior, because loading the JSON files that way may consume lots of memory (underneath the <em>require</em> directive is used).</li>\n<li><code class=\"language-text\">--esModuleInterop</code> has been introduced in <a href=\"https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop\">TypeScript 2.7</a> and is also <em>false</em> by default.\nIf you set the <code class=\"language-text\">--esModuleInterop</code> to <em>true</em>, <code class=\"language-text\">--allowSyntheticDefaultImports</code> flag will be automatically set to <em>true</em> as well. (In this tutorial we didn't use <strong>tsconfig.json</strong> yet, but if you were about to create one with <code class=\"language-text\">tsc --init</code>, the <em>esModuleInterop</em> option will be set to <em>true</em> there)</li>\n<li>TypeScript Compiler by default uses <em>ES3</em> for the <code class=\"language-text\">--target</code> flag. This automatically sets the <code class=\"language-text\">--module</code> to <em>CommonJS</em>, which in turn sets the <code class=\"language-text\">--moduleResolution</code> to <em>node</em>.\nAll these sane defaults allow us to use the <code class=\"language-text\">--resolveJsonModule</code> flag, which otherwise would not be possible. Feel free to set the <code class=\"language-text\">--module</code> or <code class=\"language-text\">--target</code> to <em>ES6</em> and verify yourself if you get a <em>TS5070</em> error code.</li>\n<li>As for the bonus, we did not need to use the <code class=\"language-text\">--esModuleInterop</code> flag. There is an alternative syntax that imports the entire module into a single variable as follows: <code class=\"language-text\">import * as settings from &quot;./settings.json&quot;</code>. </li>\n</ul>"}},"pageContext":{"postId":"9c541d56-fa9c-5abf-877f-82c87d94da32","slug":"prodding-typescript/esm-default-import-json-file"}}}