Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mapping of tsconfig compiler option 'moduleResolution' #2616

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 17 additions & 0 deletions dash/extract-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down