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

fix: better bundling of types #1785

Merged
merged 2 commits into from Aug 4, 2022

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Aug 4, 2022

Reduces the bundle size (and time for build), since we no longer bundle the same Vitest type (and its dependencies).

Before:

➜ du -sh dist/                                              
1.5Mb    dist/

After:

➜ du -sh dist/
1.4Mb    dist/

Possible fix for #1619?

@sheremet-va sheremet-va requested a review from antfu August 4, 2022 09:49
@sheremet-va
Copy link
Member Author

sheremet-va commented Aug 4, 2022

Looking for a way to fully ignore dist folder by TypeScript 🤔

@sheremet-va
Copy link
Member Author

Looking for a way to fully ignore dist folder by TypeScript 🤔

I found a wonderful flag --explainFiles 🔥

@@ -25,6 +25,7 @@
"test:ci": "cross-env CI=true pnpm -r --stream --filter !test-fails --filter !test-browser run test --allowOnly",
"test:ci:single-thread": "cross-env CI=true pnpm -r --stream --filter !test-fails run test --allowOnly --no-threads",
"typecheck": "tsc --noEmit",
"typecheck:why": "tsc --noEmit --explainFiles > explainTypes.txt",
Copy link
Member

Choose a reason for hiding this comment

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

👀? Cool magic good to know!

Copy link
Member Author

Choose a reason for hiding this comment

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

Wanted to keep it in case someone will mess up the types again 👀

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

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

I don't completely understand what is happening but I trust your judge :P

@sheremet-va sheremet-va merged commit 6ed32dd into vitest-dev:main Aug 4, 2022
@sheremet-va sheremet-va deleted the fix/build-single-types branch February 16, 2023 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants