Export an imported module

前端 未结 2 1118
一个人的身影
一个人的身影 2021-02-05 01:18

I have two javascript modules that looks like this:

// inner/mod.js
export function myFunc() {
   // ...
}

// mod.js
import * as inner from \"./inner/mod\";
         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-05 01:51

    I believe what you are looking for is

    export * from './inner/mod';
    

    That will reexports all exports of ./inner/mod. The spec actually has very nice tables listing all the possible import and export variants.

提交回复
热议问题