3 ms·
It gives a read-only peek at the scope of the imported module. import {foo} from 'bar.js'; // you can't re-bind `foo` from here, but if // a functi
by pygy_ 11y ago
It gives a read-only peek at the scope of the imported module.
import {foo} from 'bar.js';
// you can't re-bind `foo` from here, but if
// a function defined in 'bar.js' mutates it,
// the change is reflected here too.
It enables circular dependencies, for free, and makes it easy to discard unused code.
See the examples at the Rollup playground.
http://rollupjs.org http://rollupjs.org