Skip to content

Using bit.dev components in a react app makes the webpack dev server very slow to start #5510

Answered by GiladShoham
ashwanth1109 asked this question in Help
Discussion options

You must be logged in to vote

Hi,
I'm now actively working on the webpack memory consumption inside of bit.
But since you are using if I understand you correctly CRA webpack, and not bit one, it might be a different issue.
In your case, you only use the dist files created by bit.
So my best guess is that it's a result of bit compiling to CJS by default at the moment.
This means it makes webpack life harder doing tree shaking, which results in more files in the bundle, which results in more memory consumption.
I'm also actively working on changing our react env to compile to ESM by default, but I have some more work to do to complete it.
You can have a look at the PR.
Before changing the default, I'm going to give an e…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by GiladShoham
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants