-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers
Description
Bug report
Describe the bug
Currently, if the next build is targeted to serverless, the resulting files don't go through tree shaking.
To Reproduce
Checkout this repo: https://github.com/fernandobandeira/next-serverless-treeshakingissue
Just install and build the project, if you inspect the resulting index.js file, you'll see that it has 1mb and contains all of the icons from font-awesome
Expected behavior
The only icon that should appear there is the one I've imported, it shouldn't include unused code.
Additional context
For me, this is resulting in each page of my app having 16mb, more than 500mb for the entire app and 120mb zipped, which makes it impossible to deploy on aws lambda.
If you remove the target to serverless, the compiled server file only includes the cofee icon, as it should.
mmmeff, sdornan, dtkelch, daniel-minchev and otottkovacstibor
Metadata
Metadata
Assignees
Labels
good first issueEasy to fix issues, good for newcomersEasy to fix issues, good for newcomers