docs(in-depth): add dead code elimination page#8005
Conversation
How to use the Graphite Merge QueueAdd the label graphite: merge-when-ready to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
✅ Deploy Preview for rolldown-rs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
||
| ### Marking Entire Modules | ||
|
|
||
| While annotations mark individual expressions or functions, you can also mark entire modules as side-effect-free. This is equivalent to marking every statement in the module as side-effect-free. |
There was a problem hiding this comment.
This is equivalent to marking every statement in the module as side-effect-free.
This is what I was expecting. But it seems this isn't how it works in webpack (related docs) and Rollup (related docs) because the sideeffect field in the example can be "sideEffects": ["**/*.css"]...
But this definition would not allow us to do #7986. We can skip the import if the imported module is side-effect-free, instead of "if the importer module is side-effect-free".
There was a problem hiding this comment.
Great point. I was misunderstanding too🤔
|
Note: this PR describes how I understood. It's not correct as pointed out in #8005 (comment) |

No description provided.