reduce build size by adding workspace release profile
Closed this issue · 2 comments
DougAnderson444 commented
Currently the size of jco
is 10MB because there is no release profile.
What do you think of adding a release profile such as the one below which reduces the total size to about 3.5MB (1.1MB gzip) (mostly due to js-component-bindgen-component
)
// Cargo.toml
[profile.release]
codegen-units = 1 # allow for maximum size reduction optimizations
debug = false
debug-assertions = false
incremental = false
lto = true # Enable Link Time Optimization
opt-level = 'z' # Optimize for size
overflow-checks = false
panic = 'abort' # Abort on panic
rpath = false
strip = true # Automatically strip symbols from the binary.
This will help for using jco
in the browser
guybedford commented
100% agreed. Thanks for the ping on this. Added in #287.
DougAnderson444 commented
Happy to help and thanks for the quick merges @guybedford!
I will continue to experiment in the browser and pass the feedback on as I discover things.