Closed jeffposnick closed 7 years ago
Rich Harris was good enough to publish https://github.com/rollup/rollup-plugin-butternut early.
Quick-and-dirty comparison:
iife
build of sw-lib
goes from 45906 bytes (13644 gzip-ed) w/Babili to 41572 bytes (12629 gzip-ed) w/Butternut.gulp build
, covering all our build targets, completes in 12s w/Babili, 5s w/Butternut on my Macbook.I haven't looked at uglify-es
yet, and I haven't confirmed that the prod
bundles that Butternut is building don't have any subtle bugs, but that does look encouraging!
I'm revisiting this, and bumped up against https://github.com/Rich-Harris/butternut/issues/170 when trying out butternut
.
(Technically we could modify the code in question to work around the bug, as removing the async
keyword would make butternut
happy. async
isn't needed there, because the arrow function it's applied to doesn't call await
. But I don't feel great about making changes to our codebase to work around a minification bug.)
And https://www.npmjs.com/package/uglify-es doesn't support async
/await
at all yet, so that's off the table.
Is there anything else to do here? Given that you've explored and raised issues I think we just need to wait until a time that it's worth a new issue to re-explore.
butternut
resulted in bundles that were small enough that I think it's worth leaving this open, to remind us that moving to butternut
would still be a Good Thing once the output passes our test suite.
Could we not just reopen this once / if https://github.com/Rich-Harris/butternut/issues/170 is address?
Okay.
O made a PR for that bug.
uglify-es@3.0.20
supports async/await. File a bug report if there's any issue.
I'm going to take this on. Will add it as a bit of infra testing so we can quickly run and compare sizes.
V3 is using uglify-es with some pretty aggressive minifcation so I think this can be closed for now.
While we're currently using
babili
for our production builds, both https://github.com/Rich-Harris/butternut and https://www.npmjs.com/package/uglify-es might be viable options.We should do a bit of a bake-off and see what the results are for our codebase.