首页 > 解决方案 > Angular - 在根应用程序中包含库文件

问题描述

我有一个js包含多个 js 文件的文件夹的库。

当我构建它时,我成功地将所有文件包含在构建的库中。所以,文件在dist/my-lib/lib/js.

但是,例如,我无法从 URL 访问这些文件http://localhost:4200/lib/js。我能怎么做 ?

标签: angularng-packagr

解决方案


借助资产,您可以将所需的文件夹包含dist到您想要的文件夹中。

角.json:

{
  "projects": {
    "my-app": {
      "architect": {
        "build": {
          "options": {
            "assets": [
              "dist/my-lib/lib/js"
            ]
          }
        }
      }
    }
  }
}

推荐阅读