leshan icon indicating copy to clipboard operation
leshan copied to clipboard

Reduce/remove webpack build warning of servers demo.

Open sbernard31 opened this issue 3 years ago • 2 comments
trafficstars

When building leshan-server-demo or leshan-bsserver-demo, webpack raise some warnings :

E.g. for leshan-server-demo

$ vue-cli-service build --report

⠧  Building legacy bundle for production...

 WARNING  Compiled with 3 warnings                                                                                                                                                                           16:00:51

 warning  

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  fonts/materialdesignicons-webfont.aaf5968f.eot (1.11 MiB)
  fonts/materialdesignicons-webfont.ad0f7b3f.woff2 (358 KiB)
  fonts/materialdesignicons-webfont.f5b84261.ttf (1.11 MiB)
  fonts/materialdesignicons-webfont.fabeafb8.woff (516 KiB)
  css/chunk-vendors.02ffd74c.css (743 KiB)
  js/chunk-vendors-legacy.a9c5e753.js (590 KiB)

 warning  

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (1.41 MiB)
      css/chunk-vendors.02ffd74c.css
      js/chunk-vendors-legacy.a9c5e753.js
      css/app.1ab2d4c1.css
      js/app-legacy.deb2bf97.js


 warning  

webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

  File                                                  Size                                                                         Gzipped

  ../target/dist/js/chunk-vendors-legacy.a9c5e753.js    589.70 KiB                                                                   178.17 KiB
  ../target/dist/js/app-legacy.deb2bf97.js              113.69 KiB                                                                   29.11 KiB
  ../target/dist/css/chunk-vendors.02ffd74c.css         742.57 KiB                                                                   113.86 KiB
  ../target/dist/css/app.1ab2d4c1.css                   0.53 KiB                                                                     0.23 KiB

  Images and other types of assets omitted.
  Build at: 2022-04-20T14:00:53.284Z - Hash: 0332b47cfcf6a158 - Time: 43409ms


⠧  Building module bundle for production...

 WARNING  Compiled with 3 warnings                                                                                                                                                                           16:01:33

 warning  

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  fonts/materialdesignicons-webfont.aaf5968f.eot (1.11 MiB)
  fonts/materialdesignicons-webfont.ad0f7b3f.woff2 (358 KiB)
  fonts/materialdesignicons-webfont.fabeafb8.woff (516 KiB)
  fonts/materialdesignicons-webfont.f5b84261.ttf (1.11 MiB)
  css/chunk-vendors.02ffd74c.css (743 KiB)
  js/chunk-vendors.9e041928.js (482 KiB)

 warning  

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (1.3 MiB)
      css/chunk-vendors.02ffd74c.css
      js/chunk-vendors.9e041928.js
      css/app.1ab2d4c1.css
      js/app.f7c520e3.js


 warning  

webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

  File                                             Size                                                                            Gzipped

  ../target/dist/js/chunk-vendors.9e041928.js      481.81 KiB                                                                      145.06 KiB
  ../target/dist/js/app.f7c520e3.js                108.75 KiB                                                                      28.58 KiB
  ../target/dist/css/chunk-vendors.02ffd74c.css    742.57 KiB                                                                      113.86 KiB
  ../target/dist/css/app.1ab2d4c1.css              0.53 KiB                                                                        0.23 KiB

  Images and other types of assets omitted.
  Build at: 2022-04-20T14:01:35.650Z - Hash: 6279213a7167a603 - Time: 38457ms

sbernard31 avatar Apr 20 '22 15:04 sbernard31

Some hints : https://blog.jakoblind.no/3-ways-to-reduce-webpack-bundle-size/

sbernard31 avatar Apr 20 '22 16:04 sbernard31

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  fonts/materialdesignicons-webfont.aaf5968f.eot (1.11 MiB)
  fonts/materialdesignicons-webfont.ad0f7b3f.woff2 (358 KiB)
  fonts/materialdesignicons-webfont.f5b84261.ttf (1.11 MiB)
  fonts/materialdesignicons-webfont.fabeafb8.woff (516 KiB)

is removed by #1242

sbernard31 avatar Apr 21 '22 17:04 sbernard31

Since we migrate to vite (#1540) we have different warning :warning: :

For bsserver-demo :

✓ 575 modules transformed.
../target/dist/index.html                                              0.67 kB │ gzip:   0.41 kB
../target/dist/assets/logo-Mflhc2Q3.png                                4.95 kB
../target/dist/assets/roboto-vietnamese-400-normal-JAkXt1WZ.woff2      5.56 kB
../target/dist/assets/roboto-greek-400-normal-UVhwlGKP.woff2           7.11 kB
../target/dist/assets/roboto-cyrillic-400-normal-1Q02bZlk.woff2        9.63 kB
../target/dist/assets/roboto-latin-ext-400-normal-OGy6Zcg4.woff2      11.87 kB
../target/dist/assets/roboto-cyrillic-ext-400-normal-zkSvWxgI.woff2   15.34 kB
../target/dist/assets/roboto-latin-400-normal-JkyEVz-m.woff2          15.74 kB
../target/dist/assets/multicolor-leshan-R-yeoNmD.png                  22.80 kB
../target/dist/assets/roboto-all-400-normal-WSfULLFO.woff             65.46 kB
../target/dist/assets/index-QN5xfV_N.css                             446.42 kB │ gzip:  55.71 kB
../target/dist/assets/index-Szu7a8dp.js                              524.62 kB │ gzip: 159.95 kB

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 19.60s

For server-demo :

✓ 610 modules transformed.
../target/dist/index.html                                              0.67 kB │ gzip:   0.40 kB
../target/dist/assets/logo-Mflhc2Q3.png                                4.95 kB
../target/dist/assets/roboto-vietnamese-400-normal-JAkXt1WZ.woff2      5.56 kB
../target/dist/assets/roboto-greek-400-normal-UVhwlGKP.woff2           7.11 kB
../target/dist/assets/roboto-cyrillic-400-normal-1Q02bZlk.woff2        9.63 kB
../target/dist/assets/roboto-latin-ext-400-normal-OGy6Zcg4.woff2      11.87 kB
../target/dist/assets/roboto-cyrillic-ext-400-normal-zkSvWxgI.woff2   15.34 kB
../target/dist/assets/roboto-latin-400-normal-JkyEVz-m.woff2          15.74 kB
../target/dist/assets/multicolor-leshan-R-yeoNmD.png                  22.80 kB
../target/dist/assets/roboto-all-400-normal-WSfULLFO.woff             65.46 kB
../target/dist/assets/index--A-ppnc-.css                             435.01 kB │ gzip:  54.98 kB
../target/dist/assets/index-1uAEPk_1.js                              593.91 kB │ gzip: 177.61 kB

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 19.27s
Done in 20.26s.

A not successful try to resolve this : https://github.com/rollup/rollup/issues/4327#issuecomment-1823113928

sbernard31 avatar Nov 23 '23 15:11 sbernard31

with #1549, warnings are removed.

But we maybe have too much chunk now ... (move from ~10 to 40/50 chunks :grimacing: )

I close this issue anyway. If having too many chunks is an issue we will open a new ticket.

sbernard31 avatar Nov 27 '23 14:11 sbernard31