Add side effects property to components package.json#18911
Conversation
talldan
left a comment
There was a problem hiding this comment.
Looks good. I wasn't able to spot any side effects in the package, so this makes sense 👍
|
gutenberg/packages/components/package.json Lines 54 to 57 in 9eea50b @talldan, in the past you marked two files, do you remember why? |
|
gutenberg/packages/components/src/keyboard-shortcuts/index.js Lines 4 to 5 in a8c0ca9 I think this is what is concerning in this package. I'm not saying we should change anything, but we should definitely seek a way to avoid those magic imports to make reasoning easier. |
|
I think setting Yes, these two packages import something that has side-effects, but these don't need to happen unless the consumer of It would be a problem only if some other component relied implicitly on |
Description
This PR adds
sideEffects: falseto@wordpress/componentsin order to enable tree-shaking for that library, having tree shaking reduces build sizes by a significant amount.before
sideEffectsafter
sideEffects