Honestly, just delete the barrel files.
@_developit6.4万 位关注者
13,295 次观看
14 条评论
评论来自 X (Twitter) 上的原帖

@_developit
🧵 So you think you know Barrel Files
740 个赞

@_developit
Problem #1: Dead code
32 个赞

@_developit
Problem #2: Reduced clarity
22 个赞

@_developit
Problem #3: Accidental import cycles
22 个赞

@_developit
Problem #4: Infrastructure strain
26 个赞

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

@_developit
Problem #6: "Bin Files"
17 个赞

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

@_developit
A magical debarrel plugin appears
62 个赞

@_developit
Tweak your tree shaking configuration (maybe)
16 个赞

@_developit
full talk here:
127 个赞

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

@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 个赞

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