From 366b4e905e63f5d80a1f24e7874f9a9435c09701 Mon Sep 17 00:00:00 2001 From: Emil Haldrup Eriksen Date: Thu, 10 Aug 2023 09:20:16 +0200 Subject: [PATCH 1/2] Add mapping of tsconfig compiler option 'moduleResolution' from string to enum. --- dash/extract-meta.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dash/extract-meta.js b/dash/extract-meta.js index 09d593aa69..967aa8c890 100755 --- a/dash/extract-meta.js +++ b/dash/extract-meta.js @@ -38,6 +38,23 @@ if (!src.length) { if (fs.existsSync('tsconfig.json')) { tsconfig = JSON.parse(fs.readFileSync('tsconfig.json')).compilerOptions; + // Map moduleResolution to the appropriate enum. + switch (tsconfig.moduleResolution) { + case 'node': + tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeJs; + break; + case 'node16': + tsconfig.moduleResolution = ts.ModuleResolutionKind.Node16; + break; + case 'nodenext': + tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeNext; + break; + case 'classic': + tsconfig.moduleResolution = ts.ModuleResolutionKind.Classic; + break; + default: + break; + } } let failedBuild = false; From e37ce5ea9aba9ef77b81968659b93f9362b747cf Mon Sep 17 00:00:00 2001 From: Emil Haldrup Eriksen Date: Thu, 10 Aug 2023 20:59:48 +0200 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + dash/extract-meta.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b2950079..c0e189cc5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ## Fixed +- [#2616](https://github.com/plotly/dash/pull/2616) Add mapping of tsconfig compiler option `moduleResolution`, fixes [#2618](https://github.com/plotly/dash/issues/2618) - [#2596](https://github.com/plotly/dash/pull/2596) Fix react-dom throwing unique key prop error for markdown table, fix [#1433](https://github.com/plotly/dash/issues/1433) - [#2589](https://github.com/plotly/dash/pull/2589) CSS for input elements not scoped to Dash application - [#2599](https://github.com/plotly/dash/pull/2599) Fix background callback cancel inputs used in multiple callbacks and mixed cancel inputs across pages. diff --git a/dash/extract-meta.js b/dash/extract-meta.js index 967aa8c890..c9a3fb11ed 100755 --- a/dash/extract-meta.js +++ b/dash/extract-meta.js @@ -49,7 +49,7 @@ if (fs.existsSync('tsconfig.json')) { case 'nodenext': tsconfig.moduleResolution = ts.ModuleResolutionKind.NodeNext; break; - case 'classic': + case 'classic': tsconfig.moduleResolution = ts.ModuleResolutionKind.Classic; break; default: