【问题标题】:when compiling a typescript library, how to build only to es2016?编译打字稿库时,如何仅构建到 es2016?
【发布时间】:2019-11-20 21:42:38
【问题描述】:

我只是想在 es2016 中编译我的库并只获取 bundles 目录。
在 tsconfig.lib.ts 我写道:

"target": "es2016",

但是编译的时候还是出现了

Compiling TypeScript sources through ngc
Bundling to FESM2015
Bundling to FESM5
Bundling to UMD
Minifying UMD bundle
Copying declaration files
Writing package metadata

并创建大量 .d.ts 文件和各种目录:bundles、esm5、esm2015、fesm5、fesm2015
有什么方法可以停止创建所有这些文件?还是有必要?

【问题讨论】:

    标签: typescript nestjs angular-library


    【解决方案1】:

    在 tsconfig.json 文件中尝试将目标指定为 目标:“es2016” 或者在你的情况下,因为它是一个库,在 tsconfig.lib.json 中指定相同

    【讨论】:

      猜你喜欢
      • 2020-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-18
      • 2017-06-26
      • 1970-01-01
      • 2013-08-19
      • 2015-12-17
      相关资源
      最近更新 更多