elastic / tinymath

A tiny arithmetic expression evaluator with pluggable functions
Apache License 2.0
21 stars 16 forks source link

Chore: Use rollup to create bundles #28

Closed w33ble closed 6 years ago

w33ble commented 6 years ago

Closes https://github.com/elastic/tinymath/issues/3 Closes https://github.com/elastic/tinymath/issues/27

Before

Build Time: ✨ Done in 8.57s. Test Time: ✨ Done in 1.85s.

After

Build Time: ✨ Done in 4.62s. Test Time: ✨ Done in 0.62s.

Almost half the time to build, with sourcemaps enabled for the minified build and with an extra bundle file!

Also added some bundle size output as well:

src/index.js → lib/tinymath.mjs, lib/tinymath.js...
┌─────────────────────────────────────────────────┐
│                                                 │
│   Destination: lib/tinymath.mjs                 │
│   Bundle size: 63.2 KB, Gzipped size: 9.72 KB   │
│                                                 │
└─────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────┐
│                                                  │
│   Destination: lib/tinymath.js                   │
│   Bundle size: 63.57 KB, Gzipped size: 9.88 KB   │
│                                                  │
└──────────────────────────────────────────────────┘
created lib/tinymath.mjs, lib/tinymath.js in 1.4s

src/index.js → lib/tinymath.min.js...
┌──────────────────────────────────────────────────┐
│                                                  │
│   Destination: lib/tinymath.min.js               │
│   Bundle size: 16.65 KB, Gzipped size: 4.41 KB   │
│                                                  │
└──────────────────────────────────────────────────┘
created lib/tinymath.min.js in 1.9s