Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree shaking next-swc transformation #31742

Closed
padmaia opened this issue Nov 23, 2021 · 2 comments · Fixed by #32253
Closed

Tree shaking next-swc transformation #31742

padmaia opened this issue Nov 23, 2021 · 2 comments · Fixed by #32253
Assignees
Labels
SWC Related to minification/transpilation in Next.js.

Comments

@padmaia
Copy link
Member

padmaia commented Nov 23, 2021

Describe the feature you'd like to request

Add an optional next-swc transform to treeshake unused exports

@padmaia padmaia self-assigned this Nov 23, 2021
@timneutkens timneutkens added SWC Related to minification/transpilation in Next.js. kind: story and removed template: story labels Nov 23, 2021
@kdy1
Copy link
Member

kdy1 commented Nov 23, 2021

I think we can use https://docs.rs/swc_ecma_transforms_optimization/0.65.0/swc_ecma_transforms_optimization/simplify/dce/fn.dce.html ?
It does not support configuring items to preserve, but implementing it will not be hard.

Alternatively we can simply remove exports except ones we want to preserve before applying the DCE.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
SWC Related to minification/transpilation in Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants