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

Split build bundle #65

Merged
merged 4 commits into from
Apr 2, 2024
Merged

Split build bundle #65

merged 4 commits into from
Apr 2, 2024

Conversation

lubej
Copy link
Collaborator

@lubej lubej commented Mar 27, 2024

Description

  • use exact version of ethers 6.10.0 due to @oasisprotocol/sapphire-paratime dependency
  • Add rollup-plugin-visualizer, use npx vite-bundle-visualizer inside frontend folder, for report

Resources

Previously:

npx vite-bundle-visualizer
vite v5.1.4 building for production...
✓ 1238 modules transformed.
dist/index.html                                                      0.47 kB │ gzip:   0.30 kB
dist/assets/figtree-latin-ext-wght-normal-Bptc-cl5.woff2            10.10 kB
dist/assets/roboto-mono-vietnamese-wght-normal-B7nCECYT.woff2       10.26 kB
dist/assets/roboto-mono-greek-wght-normal-C58MjUu-.woff2            14.09 kB
dist/assets/roboto-mono-cyrillic-wght-normal-CK9U7V71.woff2         18.60 kB
dist/assets/figtree-latin-wght-normal-tyJnQ6lj.woff2                20.08 kB
dist/assets/roboto-mono-latin-ext-wght-normal-BWJwKVm9.woff2        22.87 kB
dist/assets/roboto-mono-latin-wght-normal-DGRqvGGI.woff2            32.94 kB
dist/assets/roboto-mono-cyrillic-ext-wght-normal-DPu6aEAn.woff2     35.89 kB
dist/assets/index-f5ltzcoX.css                                      18.48 kB │ gzip:   4.33 kB
dist/assets/index-CKw_9xB2.js                                    1,240.81 kB │ gzip: 410.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 2.95s

Screenshot_27-3-2024_14617_

Current(all assets under default 500kb limit):

npx vite-bundle-visualizer
vite v5.1.4 building for production...
✓ 1123 modules transformed.
dist/index.html                                                    0.86 kB │ gzip:   0.39 kB
dist/assets/figtree-latin-ext-wght-normal-Bptc-cl5.woff2          10.10 kB
dist/assets/roboto-mono-vietnamese-wght-normal-B7nCECYT.woff2     10.26 kB
dist/assets/roboto-mono-greek-wght-normal-C58MjUu-.woff2          14.09 kB
dist/assets/roboto-mono-cyrillic-wght-normal-CK9U7V71.woff2       18.60 kB
dist/assets/figtree-latin-wght-normal-tyJnQ6lj.woff2              20.08 kB
dist/assets/roboto-mono-latin-ext-wght-normal-BWJwKVm9.woff2      22.87 kB
dist/assets/roboto-mono-latin-wght-normal-DGRqvGGI.woff2          32.94 kB
dist/assets/roboto-mono-cyrillic-ext-wght-normal-DPu6aEAn.woff2   35.89 kB
dist/assets/index-BzmJrU6M.css                                    18.52 kB │ gzip:   4.33 kB
dist/assets/lodash-ByOxUBs_.js                                    28.11 kB │ gzip:  11.56 kB │ map:   228.29 kB
dist/assets/index-awQyAFrF.js                                     47.58 kB │ gzip:  16.91 kB │ map:   129.14 kB
dist/assets/react-dom-Ddi3USIR.js                                167.92 kB │ gzip:  52.75 kB │ map:   504.61 kB
dist/assets/ethers-DN1VZNda.js                                   175.44 kB │ gzip:  51.72 kB │ map:   801.14 kB
dist/assets/recharts-DGNO4Vbe.js                                 216.23 kB │ gzip:  51.07 kB │ map:   857.16 kB
dist/assets/vendor-C7c7JVNO.js                                   386.25 kB │ gzip: 147.39 kB │ map: 1,674.81 kB
✓ built in 2.92s

Screenshot_27-3-2024_14413_

frontend/package.json Outdated Show resolved Hide resolved
@lubej lubej requested a review from lukaw3d March 28, 2024 05:18
@lubej lubej force-pushed the ml/split-chunks branch 2 times, most recently from 0bd89d0 to 6eecd05 Compare April 2, 2024 17:12
- due to @oasisprotocol/sapphire-paratime dependency
- add splitVendorChunkPlugin
- add visualize:bundle command using vite-bundle-vizualizer
@lubej lubej merged commit f2f15d0 into master Apr 2, 2024
2 checks passed
@lubej lubej deleted the ml/split-chunks branch April 2, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants