As others have already pointed out, a lot of this is a (valid) complaint about tooling. A couple of remarks I do have, though:
Adding named exports: If you started with a default export, and want to export more, the import syntax can accommodate you quite easily: Go from import theDefault from "./module.js"; to import theDefault, {namedExport1, namedExport2} from "./module.js";
Re-exporting: Note that you can do export {default} from "./module.js"; or even rename exports export {default as nowWithName} from "./module.js";
35
u/dassurma Aug 27 '18 edited Aug 27 '18
As others have already pointed out, a lot of this is a (valid) complaint about tooling. A couple of remarks I do have, though:
Adding named exports: If you started with a default export, and want to export more, the import syntax can accommodate you quite easily: Go from
import theDefault from "./module.js";toimport theDefault, {namedExport1, namedExport2} from "./module.js";Re-exporting: Note that you can do
export {default} from "./module.js";or even rename exportsexport {default as nowWithName} from "./module.js";