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

improve splitChunks config for webpack 5 #21208

Merged
merged 2 commits into from Jan 17, 2021

Conversation

sokra
Copy link
Member

@sokra sokra commented Jan 15, 2021

  • enable default cache groups in webpack 5
  • remove shared cache group

@ijjk
Copy link
Member

ijjk commented Jan 15, 2021

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary sokra/next.js feature/split-chunk Change
buildDuration 10.4s 10.8s ⚠️ +377ms
nodeModulesSize 77.5 MB 77.5 MB -47 B
Page Load Tests Overall increase ✓
vercel/next.js canary sokra/next.js feature/split-chunk Change
/ failed reqs 0 0
/ total time (seconds) 2.107 2.112 0
/ avg req/sec 1186.56 1183.86 ⚠️ -2.7
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.535 1.516 -0.02
/error-in-render avg req/sec 1628.82 1649.6 +20.78
Client Bundles (main, webpack, commons)
vercel/next.js canary sokra/next.js feature/split-chunk Change
677f882d2ed8..43e3.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-712e20f..aa05.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary sokra/next.js feature/split-chunk Change
polyfills-af..9390.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary sokra/next.js feature/split-chunk Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary sokra/next.js feature/split-chunk Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary sokra/next.js feature/split-chunk Change
index.html gzip 615 B 615 B
link.html gzip 620 B 620 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode (Decrease detected ✓)
General Overall decrease ✓
vercel/next.js canary sokra/next.js feature/split-chunk Change
buildDuration 12.6s 12.6s ⚠️ +69ms
nodeModulesSize 77.5 MB 77.5 MB -47 B
Client Bundles (main, webpack, commons)
vercel/next.js canary sokra/next.js feature/split-chunk Change
677f882d2ed8..43e3.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-712e20f..aa05.js gzip 6.63 kB 6.63 kB
webpack-50be..df5b.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary sokra/next.js feature/split-chunk Change
polyfills-af..9390.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary sokra/next.js feature/split-chunk Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary sokra/next.js feature/split-chunk Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary sokra/next.js feature/split-chunk Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.18 MB 5.18 MB

Webpack 5 Mode (Increase detected ⚠️)
General Overall decrease ✓
vercel/next.js canary sokra/next.js feature/split-chunk Change
buildDuration 12.9s 13.7s ⚠️ +800ms
nodeModulesSize 77.5 MB 77.5 MB -47 B
Page Load Tests Overall decrease ⚠️
vercel/next.js canary sokra/next.js feature/split-chunk Change
/ failed reqs 0 0
/ total time (seconds) 2.059 2.152 ⚠️ +0.09
/ avg req/sec 1214.44 1161.59 ⚠️ -52.85
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.465 1.506 ⚠️ +0.04
/error-in-render avg req/sec 1706.59 1660.02 ⚠️ -46.57
Client Bundles (main, webpack, commons) Overall increase ⚠️
vercel/next.js canary sokra/next.js feature/split-chunk Change
677f882d2ed8..8972.js gzip 13 kB 13 kB
framework.HASH.js gzip 39.3 kB 39.3 kB
main-41e0469..878f.js gzip 6.58 kB 6.56 kB -19 B
webpack-9ff4..949b.js gzip 954 B 954 B
main-6a6a792..6877.js gzip N/A 96 B N/A
polyfills-79..a497.js gzip N/A 31.1 kB N/A
Overall change 59.8 kB 91 kB ⚠️ +31.2 kB
Legacy Client Bundles (polyfills) Overall decrease ✓
vercel/next.js canary sokra/next.js feature/split-chunk Change
polyfills-79..a497.js gzip 31.1 kB N/A N/A
polyfills-a0..538c.js gzip N/A 88 B N/A
Overall change 31.1 kB 88 B -31 kB
Client Pages Overall increase ⚠️
vercel/next.js canary sokra/next.js feature/split-chunk Change
_app-cb93cf7..8ff9.js gzip 1.26 kB 1.26 kB
_error-6f1f9..5577.js gzip 3.38 kB 3.38 kB
hooks-725de8..0a15.js gzip 904 B 904 B
index-939503..6e1c.js gzip 232 B 232 B
link-875eb08..b6cf.js gzip 1.63 kB 1.63 kB
routerDirect..d724.js gzip 308 B 308 B
withRouter-5..3a90.js gzip 303 B 304 B ⚠️ +1 B
Overall change 8.02 kB 8.02 kB ⚠️ +1 B
Client Build Manifests
vercel/next.js canary sokra/next.js feature/split-chunk Change
_buildManifest.js gzip 299 B 299 B
Overall change 299 B 299 B
Rendered Page Sizes Overall decrease ✓
vercel/next.js canary sokra/next.js feature/split-chunk Change
index.html gzip 613 B 586 B -27 B
link.html gzip 619 B 592 B -27 B
withRouter.html gzip 607 B 580 B -27 B
Overall change 1.84 kB 1.76 kB -81 B

Diffs

Diff for index.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/",
         "query": {},
-        "buildId": "_Gm3JCnQ5iqjPZUjGsEcq",
+        "buildId": "l9YQB5YMs4bh1T51hlDKI",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/_Gm3JCnQ5iqjPZUjGsEcq/_buildManifest.js"
+      src="/_next/static/l9YQB5YMs4bh1T51hlDKI/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/_Gm3JCnQ5iqjPZUjGsEcq/_ssgManifest.js"
+      src="/_next/static/l9YQB5YMs4bh1T51hlDKI/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for link.html
@@ -48,7 +48,7 @@
         "props": { "pageProps": {} },
         "page": "/link",
         "query": {},
-        "buildId": "_Gm3JCnQ5iqjPZUjGsEcq",
+        "buildId": "l9YQB5YMs4bh1T51hlDKI",
         "isFallback": false,
         "gip": true
       }
@@ -82,11 +82,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/_Gm3JCnQ5iqjPZUjGsEcq/_buildManifest.js"
+      src="/_next/static/l9YQB5YMs4bh1T51hlDKI/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/_Gm3JCnQ5iqjPZUjGsEcq/_ssgManifest.js"
+      src="/_next/static/l9YQB5YMs4bh1T51hlDKI/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for withRouter.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/withRouter",
         "query": {},
-        "buildId": "_Gm3JCnQ5iqjPZUjGsEcq",
+        "buildId": "l9YQB5YMs4bh1T51hlDKI",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/_Gm3JCnQ5iqjPZUjGsEcq/_buildManifest.js"
+      src="/_next/static/l9YQB5YMs4bh1T51hlDKI/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/_Gm3JCnQ5iqjPZUjGsEcq/_ssgManifest.js"
+      src="/_next/static/l9YQB5YMs4bh1T51hlDKI/_ssgManifest.js"
       async=""
     ></script>
   </body>
Commit: d3c43b5

Copy link
Member

@timneutkens timneutkens left a comment

Looks like the stats reporting for the polyfills bundle is slightly off but besides that this looks good 💯

@timneutkens timneutkens merged commit b02df3f into vercel:canary Jan 17, 2021
28 of 30 checks passed
timneutkens added a commit to timneutkens/next.js that referenced this issue Jan 19, 2021
@sokra sokra deleted the feature/split-chunk branch Jan 19, 2021
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants