如何在文件结构中组织nodejs导出,但没有创build具有相同结构的文件
我有一个像这样的文件结构的库
root |-- index.js |-----folder1 |---- module a .... .... other modules that under other folders
我不希望图书馆的用户这样input模块a
import {...} from "mylibrary/folder1/moudleAIndex"
如果开发者可以做的话就会很好
import {...} from "mylibrary/moduleA"
有没有办法做到上面没有改变我当前的文件结构?
使用以下内容创build一个mylibrary/moduleA.js
文件:
import * as moduleA from './folder1/moudleAIndex'; export moduleA;
- 在打字稿中找不到'autobind-decorator'的声明文件
- 如何在Typescript中的方法装饰器上创build编译错误?
- Typescript和Node js得到“不是函数错误”
- Typescript声明合并:重写?
- 如何find在Node + Typescript + VSCodeasynchronous函数调用缺less的等待?
- 如何在angular度2项目中使用“regression-js”
- 导入http = require('http'); 并从http导入*作为http;
- typescript node.js表示路由分隔文件的最佳实践
- tsc生成.d.ts文件给出错误“找不到命名空间”Jimp“