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

Don’t add loadable if it’s not used #7995

Merged

Conversation

timneutkens
Copy link
Member

Part of #7536 separated out so it can be merged.

This makes sure next/dynamic is not added when it's not used, decreasing default bundle sizes.

@github-actions
Copy link
Contributor

Stats from current PR

Click to expand stats
zeit/next.js canary timneutkens/next.js fix/only-add-loadable-when-needed Change
Build Duration 14.3s 13.1s -1.2s
node_modules Size 45.5 MB 45.5 MB -77 B
Total Bundle (main, webpack, commons) Size 210 kB 206 kB -3.87 kB
Total Bundle (main, webpack, commons) gzip Size 68.8 kB 67.8 kB -1.04 kB
Client _app Size 2.39 kB 2.39 kB
Client _app gzip Size 1.08 kB 1.08 kB
Client _error Size 8.45 kB 8.45 kB
Client _error gzip Size 3.24 kB 3.24 kB
Client pages/index Size 296 B 296 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.14 kB 4.14 kB
Client pages/link gzip Size 1.82 kB 1.82 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client main Size 23.7 kB 19.8 kB -3.87 kB
Client main gzip Size 7.82 kB 6.78 kB -1.04 kB
Client commons Size 184 kB 184 kB
Client commons gzip Size 59.7 kB 59.7 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 770 B 770 B
Base Rendered Size 1.36 kB 1.36 kB
Build Dir Size 757 kB 737 kB -19.7 kB
Click to expand serverless stats
zeit/next.js canary timneutkens/next.js fix/only-add-loadable-when-needed Change
Build Duration 15.2s 15s -159ms
node_modules Size 45.5 MB 45.5 MB -77 B
Total Bundle (main, webpack, commons) Size 210 kB 206 kB -3.87 kB
Total Bundle (main, webpack, commons) gzip Size 68.8 kB 67.8 kB -1.04 kB
Client _app Size 2.39 kB 2.39 kB
Client _app gzip Size 1.08 kB 1.08 kB
Client _error Size 8.45 kB 8.45 kB
Client _error gzip Size 3.24 kB 3.24 kB
Client pages/index Size 296 B 296 B
Client pages/index gzip Size 222 B 222 B
Client pages/link Size 4.14 kB 4.14 kB
Client pages/link gzip Size 1.82 kB 1.82 kB
Client pages/routerDirect Size 423 B 423 B
Client pages/routerDirect gzip Size 306 B 306 B
Client pages/withRouter Size 435 B 435 B
Client pages/withRouter gzip Size 301 B 301 B
Client main Size 23.7 kB 19.8 kB -3.87 kB
Client main gzip Size 7.82 kB 6.78 kB -1.04 kB
Client commons Size 184 kB 184 kB
Client commons gzip Size 59.7 kB 59.7 kB
Client webpack Size 1.49 kB 1.49 kB
Client webpack gzip Size 770 B 770 B
Serverless pages/link Size 338 kB 338 kB ⚠️ +96 B
Serverless pages/link gzip Size 86.8 kB 86.9 kB ⚠️ +23 B
Serverless pages/index Size Error getting size Error getting size
Serverless pages/index gzip Size Error getting size Error getting size
Serverless pages/_error Size 328 kB 329 kB ⚠️ +96 B
Serverless pages/_error gzip Size 84.1 kB 84.2 kB ⚠️ +23 B
Serverless pages/routerDirect Size 330 kB 330 kB ⚠️ +96 B
Serverless pages/routerDirect gzip Size 84.4 kB 84.4 kB ⚠️ +17 B
Serverless pages/withRouter Size 330 kB 330 kB ⚠️ +96 B
Serverless pages/withRouter gzip Size 84.4 kB 84.4 kB ⚠️ +22 B
Build Dir Size 1.95 MB 1.94 MB -7.23 kB

@timneutkens timneutkens merged commit 5030486 into vercel:canary Jul 16, 2019
@timneutkens timneutkens deleted the fix/only-add-loadable-when-needed branch July 16, 2019 12:52
@timneutkens timneutkens added this to the 9.0.2 milestone Jul 16, 2019
@vercel vercel locked as resolved and limited conversation to collaborators Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant