Visitar URL original
docs(in-depth): add dead code elimination page by sapphi-red · Pull Request #8005 · rolldown/rolldown · GitHub
Skip to content

docs(in-depth): add dead code elimination page - #8005

Closed
sapphi-red wants to merge 1 commit into
mainfrom
01-22-docs_in-depth_add_dead_code_elimination_page
Closed

sapphi-red wants to merge 1 commit into
mainfrom
01-22-docs_in-depth_add_dead_code_elimination_page

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add 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.

@netlify

netlify Bot commented Jan 22, 2026

Copy link
Copy Markdown

✅ Deploy Preview for rolldown-rs ready!

Name Link
🔨 Latest commit 9a60144
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/6971b29b0cad4c00089d2951
😎 Deploy Preview https://deploy-preview-8005--rolldown-rs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

@shulaoda shulaoda Jan 22, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point. I was misunderstanding too🤔

@sapphi-red

Copy link
Copy Markdown
Member Author

Note: this PR describes how I understood. It's not correct as pointed out in #8005 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants