Export before declarations.We can label any declaration as exported by placing export before it, be it… Named export
Default export
export class User {...}
export default class User {...}… export * from './user.js' re-exports only named exports, but ignores the default one.… Standalone export:
export {x [as y], ...}.… re-export default).
export {default [as y]} from "module" (re-export default).
Export and import statements that we covered in previous chapters are called “static”.… run-time:
That’s because import/export… structure can be analyzed, modules can be gathered and bundled into one file by special tools, unused exports… That’s possible only because the structure of imports/exports is simple and fixed.… :
Or, if say.js has the default export
Then its exports are given to all further importers.… Then it can export a configuration object expecting the outer code to assign to it.… Unused exports removed (“tree-shaking”).… Exports are created once and shared between importers.… When we use modules, each module implements the functionality and exports it.