FlowFuse / FlowFuse/flowfuse

Reduce Total Bundle Size

Open
#1,214 2 comments 0 reactions 0 assignees View on GitHub
task
Dominant language
JavaScript
Stars
400
Forks
89
Avg merge
1d 20h
Merged PRs (30d)
149

Description

### Description

Total bundle size is one of the most important factors in time to first paint for a SPA.

Today, the JS bundle alone is over 2MB when built, made up of:

- vendors.js (1 MB)
- main.js (602.76 KB)
- set up.js (589.28 KB)
- runtime.js (1.69 KB)

Ideally, these files should be < 244 KiB

Screenshot 2022-11-14 at 13 28 11

There are some quick wins in FlowForges dependencies that will reduce the bundle size at low dev effort:

- [ ] Remove Moment.js and replace with a modern alternative such as Day.js
- [ ] Ensure tree shaking is working for @heroicons/vue to only import used icons

Other targets that might be more involved:

- [ ] Duplication between main.js and setup.js
- [ ] Splitting into sub-bundles

### Epic/Story

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.