CommonJS to ESM in Node.js

With Node 12 and up supporting ES Modules natively and Node 10 — the last version to not support it unflagged — going EOL, it’s time to start migrating your code to ES Modules. Aral Balkan took the time to convert his tool “Place” to embrace them and documented his work: Yesterday, I refactored Place, …

Snowpack – build modern web apps without a bundler

Must say I’m quite excited about Snowpack (formerly known as @pika/web, which I covered here) which just got released. With Snowpack you can build modern web apps (with React, Vue, etc.) without a bundler (like Webpack, Parcel, Rollup). No more waiting for your bundler every time you hit save. Instead, changes are ready in the …

Making Future Interfaces: ES Modules

Once again a highly entertaining video by Heydon Pickering. This time he’s tackling ES Modules: how and where (e.g. in which browsers) can you use them? 💁‍♂️ Even if you already know how to ship ES2015 JavaScript to browsers the video still is worth your time, as it’s very fun to watch!

ESNext: Dynamically import ES modules with “dynamic import()

UPDATE June 2019: This feature has now advanced to Stage-4 and will be part of the ES2020 Specification! 🎉 One of the recent ECMAScript proposals that landed in Chrome 63 is dynamic import(): Dynamic import() introduces a new function-like form of import, which allows one to import on demand. It returns a promise for the …

Shipping ES6 ES2015 Modules to Browsers

UPDATE 2017.09.13: Deploying ES2015+ Code in Production Today also provides a good writeup on this subject. Good workflow fleshed out by Sam Thorogood on using ES2015/ES6 modules with browsers that support, whilst also keeping older browsers (that don’t support it) happy. The modules Let’s take these 2 simple modules for example: // main.js import {x} …