Export * from …
This syntax is used to re-export all named exports from another module. It does not work for default exports.
1 | // math.mjs |
File index.mj re-exports all named exports from math.mjs, in this case, add and subtract, but not multiply, since it is a default export.
1 | // index.mjs |
Now you can import all named exports from index.mjs using the following syntax:
1 | // main.mjs |