Honestly, just delete the barrel files.
@_developit64K followers
13,295 views
14 Comments
Comments from the original post on X (Twitter)

@_developit
🧵 So you think you know Barrel Files
740 likes

@_developit
Problem #1: Dead code
32 likes

@_developit
Problem #2: Reduced clarity
22 likes

@_developit
Problem #3: Accidental import cycles
22 likes

@_developit
Problem #4: Infrastructure strain
26 likes

@_developit
Problem #5: Testing code shipped to production
17 likes

@_developit
Problem #6: "Bin Files"
17 likes

@_developit
Some solutions! To start... can linting help?
17 likes

@_developit
A magical debarrel plugin appears
62 likes

@_developit
Tweak your tree shaking configuration (maybe)
16 likes

@_developit
full talk here:
127 likes

@dougesdev
@flexdinesh 4r. Shopify sending it for no barrel? Atlassian started migrating Jira recently, huge improvements across the board
4 likes

@theKashey
We just did that Rewrote all imports directly to what they need and deleted thousands of barrel files It helped not only with bundling, but boosted tests and even typescript
2 likes

@_developit
Yeah the impact on jest and TS are big.