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

chore: improve tsconfig #180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
"noEmit": true,
"module": "ESNext",
"target": "ESNext",
"moduleResolution": "node",
"moduleResolution": "Bundler",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bundler is good for apps, but node16 is better for libraries. that's because bundler is more permissive about things like file endings, which is good for consuming a variety of libraries, but node16 is stricter, which is better when your library may be consumed by apps with a variety of different settings

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in the end it will be changed by unbuild. Do you think it's still worth it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with unbuild or why they would do that. Ideally it shouldn't or there should be an option to configure it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unbuild imports all the code and puts it in a single file, then minimizes it, so there is no import after it has been compiled. It means that the moduleResolution won't have any impact after all.

"moduleDetection": "force",
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"lib": ["ES2022"],
"paths": {
"@clack/core": ["./packages/core/src"]
}
Expand Down
Loading