Fixing module resolution within IDEs#592
Merged
mcottontensor merged 2 commits intoEpicGamesExt:masterfrom Apr 10, 2025
Merged
Conversation
Without these changes the IDE fails to find some imports and made it hard for things like intellisense and auto complete etc. It shouldn't make a difference with actual builds because the moduleResolution is overridden anyway.
node10 is the default moduleResolution for cjs projects so this is just explicitly setting that so that the bundler entry from the base gets properly overwritten.
|
github-actions bot
pushed a commit
that referenced
this pull request
Apr 10, 2025
* Fixing tsconfigs to help IDEs resolve imports. Without these changes the IDE fails to find some imports and made it hard for things like intellisense and auto complete etc. It shouldn't make a difference with actual builds because the moduleResolution is overridden anyway. * Explicitly setting CJS projects to node10 moduleResolution. node10 is the default moduleResolution for cjs projects so this is just explicitly setting that so that the bundler entry from the base gets properly overwritten. (cherry picked from commit f3e0e91)
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
mcottontensor
added a commit
that referenced
this pull request
Apr 10, 2025
* Fixing tsconfigs to help IDEs resolve imports. Without these changes the IDE fails to find some imports and made it hard for things like intellisense and auto complete etc. It shouldn't make a difference with actual builds because the moduleResolution is overridden anyway. * Explicitly setting CJS projects to node10 moduleResolution. node10 is the default moduleResolution for cjs projects so this is just explicitly setting that so that the bundler entry from the base gets properly overwritten. (cherry picked from commit f3e0e91) Co-authored-by: mcottontensor <80377552+mcottontensor@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem statement:
I noticed recently that my IDE was complaining about not finding certain imports which was breaking a lot of intellisense stuff. Turns out if was related to recent tsconfig changes.
Solution
In the base tsconfig of each project I have changed the moduleResolution to 'bundler' which allows the IDE to properly resolve all imports since it only looks at the base tsconfig.json and not the module specific cjs or esm versions.
Additionally I have set moduleResolution to 'node10' in the cjs configs since this is the default setting for cjs modules. The esm versions already had the proper setting. This ensures that the bundler setting is properly changed in each actual build.