The static
import
statement is used toimport
read only live bindings which are exported by another module.(c) MDN
🐊Putout plugin adds ability to find and merge duplicate imports. Merged to @putout/plugin-esm
.
npm i @putout/plugin-merge-duplicate-imports
{
"rules": {
"merge-duplicate-imports/join": "on",
"merge-duplicate-imports/rename": "on"
}
}
import test from 'supertape';
import {stub} from 'supertape';
import test, {stub} from 'supertape';
Checkout in 🐊Putout Editor.
import putout from './putout.js';
import all from './putout.js';
import x from './putout.js';
console.log(all);
console.log(x);
import putout from './putout.js';
console.log(putout);
console.log(putout);
MIT