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

Build extension bundle with smaller chunks for Firefox #1036

Open
lukaw3d opened this issue Sep 27, 2022 · 0 comments
Open

Build extension bundle with smaller chunks for Firefox #1036

lukaw3d opened this issue Sep 27, 2022 · 0 comments
Labels
extension firefox Mozilla browsers-related issues p:2 Priority: potential feature

Comments

@lukaw3d
Copy link
Member

lukaw3d commented Sep 27, 2022

Related #904
Related #771

#904 replaced "background": { "scripts": with "background": { "page": so that asynchronous chunks would be loaded correctly. But it seems that our bundle is now 1 big chunk:

build/index.html                                         1.33 KB     634ms
build/favicon.1644430d.ico                               4.19 KB      59ms
build/logo192.3188d2e4.png                                1.8 KB     205ms
build/app.webmanifest                                      546 B      59ms
build/logo512.30a4930a.png                               5.36 KB     205ms
build/index.053a7c5d.js                               ⚠️  7.2 MB    21.38s
build/dump_validators.cd9b44c1.js                       67.38 KB     557ms
build/index.f7aea59f.css                                 3.15 KB     653ms
build/rubik-v20-latin-ext_latin-300.c36c8cce.woff2      20.12 KB     196ms
build/rubik-v20-latin-ext_latin-300.fa35505d.woff       26.21 KB      59ms
build/roboto-mono-v13-latin-300.7a9692de.woff2           12.4 KB     195ms
build/roboto-mono-v13-latin-300.592ef339.woff            15.2 KB      59ms
Removing .terserrc and enabling scopeHoist doesn't create more chunks or treeshake grommet-icons

By removing .terserrc beautification we could get a smaller chunk and worse stack traces

build/index.html                                          1.33 KB     641ms
build/favicon.1644430d.ico                                4.19 KB      89ms
build/logo192.3188d2e4.png                                 1.8 KB     234ms
build/app.webmanifest                                       546 B      89ms
build/logo512.30a4930a.png                                5.36 KB     235ms
build/index.2ea5eaec.js                               ⚠️  4.24 MB    21.17s
build/dump_validators.8b4f4f83.js                        66.61 KB     570ms
build/index.f7aea59f.css                                  3.15 KB     581ms
build/rubik-v20-latin-ext_latin-300.c36c8cce.woff2       20.12 KB     221ms
build/rubik-v20-latin-ext_latin-300.fa35505d.woff        26.21 KB      90ms
build/roboto-mono-v13-latin-300.7a9692de.woff2            12.4 KB     221ms
build/roboto-mono-v13-latin-300.592ef339.woff             15.2 KB      90ms

reporter-bundle-analyzer

By removing .terserrc beautification and enabling scopeHoist to allow better treeshaking, we don't gain much. It creates separate slightly differently pruned entrypoints for ext and web:

build/index.html                                          1.41 KB    20.92s
build/favicon.1644430d.ico                                4.19 KB      77ms
build/logo192.3188d2e4.png                                 1.8 KB     1.55s
build/app.webmanifest                                       546 B      76ms
build/logo512.30a4930a.png                                5.36 KB     1.55s
build/index.6d97256d.js                               ⚠️  4.24 MB    20.45s
build/dump_validators.d25adec3.js                        65.67 KB    20.86s
build/index.e9b13657.css                                  3.15 KB     1.45s
build/rubik-v20-latin-ext_latin-300.c36c8cce.woff2       20.12 KB     257ms
build/rubik-v20-latin-ext_latin-300.fa35505d.woff        26.21 KB      77ms
build/roboto-mono-v13-latin-300.7a9692de.woff2            12.4 KB     257ms
build/roboto-mono-v13-latin-300.592ef339.woff             15.2 KB      77ms
build/index.0f22dd9a.js                               ⚠️  4.09 MB    20.89s
build/logo192.3188d2e4.png                                 1.8 KB     1.45s
build/dump_validators.4532afe3.js                        65.67 KB    20.86s

Add a test too

@lukaw3d lukaw3d changed the title Bundle size chunks Build a bundle with smaller chunks for Firefox Sep 27, 2022
@lukaw3d lukaw3d changed the title Build a bundle with smaller chunks for Firefox Build extension bundle with smaller chunks for Firefox Sep 27, 2022
@lukaw3d lukaw3d added p:2 Priority: potential feature firefox Mozilla browsers-related issues extension labels Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension firefox Mozilla browsers-related issues p:2 Priority: potential feature
Projects
None yet
Development

No branches or pull requests

1 participant