相关疑难解决方法(0)

如何在不导入“ dist”的情况下在NPM上发布TypeScript模块?

我正在尝试在NPM上发布一个打字稿库,但是发布后我找不到“好的”路径。

在这一点上,我遵循一些指南,但是找不到解决方案。

问题:因此,请考虑以下结构:

dist
 |- Alls files generated after tsc build
lib
 |- All TS files of library (source)
CHANGELOG.md
LICENSE
package.json
README.md
tsconfig.json
Run Code Online (Sandbox Code Playgroud)

发布后,例如在Angular应用程序中,我将键入:

import {Component} from '<library name>/dist/Component';
Run Code Online (Sandbox Code Playgroud)

我的问题:如何配置项目导入到有from '<library name>/Component'代替from '<library name>/dist/Component'吗?

谢谢

npm typescript angular

7
推荐指数
2
解决办法
1429
查看次数

标签 统计

angular ×1

npm ×1

typescript ×1