簡體   English   中英

Angular ng 構建不生成 dist 文件夾

[英]Angular ng build does not produce dist folder

我很沮喪,因為我運行了 ng build 但它沒有在項目文件夾中生成 dist 文件夾。 我對其他項目沒有問題。 奇怪的是編譯器沒有給出任何錯誤。 有人可以檢查我的項目並告訴原因嗎? https://github.com/vugar005/報告親切的問候

我已經看到您的存儲庫,並且我認為問題出在您的“ .angular-cli.json”文件上。 在第9行中,將outDir指定為“ ../MHS”,它將結果生成到“ ../MHS”文件夾中,而不是“ dist”文件夾中。

為了解決您的問題,您可以將outDir從“ ../MHS”更改為“ dist”。

希望它有效! :) -mczal

這不適用於此特定案例,但它可能會幫助其他遇到相同問題的人。

在 angular.json 中:

projects.<project name>.architect.build.configurations.<configuration>.tsconfig

被設置為一個不存在的文件。 將其更改為正確的文件解決了我的問題。

{
  /* other configuration */
  "projects": {
    /* other configuration */
    "my-library": {
      /* other configuration */
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:ng-packagr",
          "options": {
            "project": "projects/my-library/ng-package.json"
          },
          "configurations": {
            "production": {
              /* this used to be a file that did not exist */
              "tsConfig": "projects/my-library/tsconfig.json"
            },
            "development": {
              /* this used to be a file that did not exist */
              "tsConfig": "projects/my-library/tsconfig.json"
            }
          }
        }
      }
    }
  }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM