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 09d593aa69..c9a3fb11ed 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;