store.js icon indicating copy to clipboard operation
store.js copied to clipboard

Reduce build sizes

Open marcuswestin opened this issue 8 years ago • 8 comments
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

marcuswestin avatar Feb 28 '17 22:02 marcuswestin

Also see #129

marcuswestin avatar Feb 28 '17 22:02 marcuswestin

  • Consider removing non-shim implementations in util.js

marcuswestin avatar Feb 28 '17 22:02 marcuswestin

  • Consider splitting up util.js to only keep functions store-engine.js depends on (for a minimal build)

marcuswestin avatar Feb 28 '17 23:02 marcuswestin

  • consider not using util.js in store-engine.js

marcuswestin avatar Feb 28 '17 23:02 marcuswestin

  • Consider splitting out plugin code into its own file, and not importing it in store.minimal.js

marcuswestin avatar Feb 28 '17 23:02 marcuswestin

  • 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.

marcuswestin avatar Feb 28 '17 23:02 marcuswestin

You could use rollup, since that can heavily improve the size of a bundle with treeshaking + putting everything in the same scope.

PaulBGD avatar Mar 01 '17 02:03 PaulBGD

@PaulBGD 👍👍 wasn't aware of rollup! Will check it out - thanks!

marcuswestin avatar Mar 01 '17 12:03 marcuswestin