Philip Walton suggests making two copies of your production JavaScript. Easy enough to do with a Babel-based build process.
<!-- Browsers with ES module support load this file. -->
<script type="module" src="main.js"></script>
<!-- Older browsers load this file (and module-supporting -->
<!-- browsers know *not* to load this file). -->
<script nomodule src="main-legacy.js"></script>
He put together a demo project for it all and you're looking at 50% file size savings. I would think there would be other speed improvements as well, by using modern JavaScript methods directly.
Direct Link to Article — Permalink
Deploying ES2015+ Code in Production Today is a post from CSS-Tricks
from CSS-Tricks http://ift.tt/2f62izm
via IFTTT
No comments:
Post a Comment