- ESM files can `import` CommonJS files and packages using full ES2015 syntax, the same as if the module to be imported was ESM. - ESM importing a member of a CommonJS module is understood by bundlers for the purpose of tree-shaking. - A CommonJS module that does things that are impossible in ESM (assuming there still are any such things) can still be imported by an ESM file. ```js // a.js module.exports = { b: 10 }; // b.js import { b } from './a.js'; console.log(b); // 10 ``` Use cases 8, 10, 12, 18, 39, 20, 40, 41, 42, 47, 48. _I know this is a rather huge feature, so it’s probably best to break out the components that make it up into issues of their own._
importCommonJS files and packages using full ES2015 syntax, the same as if the module to be imported was ESM.Use cases 8, 10, 12, 18, 39, 20, 40, 41, 42, 47, 48.
I know this is a rather huge feature, so it’s probably best to break out the components that make it up into issues of their own.