-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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 baseUrl documentation #6847
Conversation
"compilerOptions": { | ||
"baseUrl": "src" | ||
}, | ||
"include": ["src/**/*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed. I could definitely be wrong about that though. When I was testing this I wasn't using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You definitely don't need it, you're right. It's recommended by VS Code team to avoid performance issues when you add this file. This link explains it well: https://code.visualstudio.com/docs/languages/jsconfig. The key thing to note:
If you do not have a jsconfig.json in your workspace, VS Code will by default exclude the node_modules folder.
When your JavaScript project is growing too large and performance slows, it is often because of library folders like node_modules. If VS Code detects that your project is growing too large, it will prompt you to edit the exclude list.
So once we add this file, it by default will include everything in the directory of jsconfig.json
and all subdirectories, including node_modules
. By using include
it explicitly says "only check these files, thanks!", which is equivalent to how we have our configuration for tsconfig.json
.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems like a pretty good reason to me.
Thank you for doing this. ❤️ |
Co-Authored-By: ianschmitz <[email protected]>
Co-Authored-By: ianschmitz <[email protected]>
"compilerOptions": { | ||
"baseUrl": "src" | ||
}, | ||
"include": ["src"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to specify src
here? I haven't tested, just wondering... if not, we could simplify this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for absolute imports. It’s used to specify which files should be included for TypeScript compilation and/or which files should be analyzed by the IDE.
Closes #6765.
/cc @rovansteen, @iansu, @mrmckeb