store.js
store.js copied to clipboard
Reduce build sizes
trafficstars
Current build sizes are a bit bigger than v1.
- Figure out sources of bloat (e.g do lots of modules add a bunch of boilerplate?)
- Consider trying other minifiers, e.g closure
- Compare gzipped sizes
Also see #129
- Consider removing non-shim implementations in util.js
- Consider splitting up util.js to only keep functions store-engine.js depends on (for a minimal build)
- consider not using util.js in store-engine.js
- Consider splitting out plugin code into its own file, and not importing it in store.minimal.js
- Allow uglifyjs to mangle property names (store.js v1 did much of this manually by using almost exclusively locally scoped variables instead of objects)
- Create a minimal build which doesn't depend on the browserify require module runtime, but uses minimal file concatenation of store-engine.js and a minimal-build.js.
You could use rollup, since that can heavily improve the size of a bundle with treeshaking + putting everything in the same scope.
@PaulBGD 👍👍 wasn't aware of rollup! Will check it out - thanks!