首页 > 解决方案 > 离子构建到 /dist 文件夹而不是 /www

问题描述

当我运行时ionic build,它总是会构建一个新/dist文件夹,其中包含您通常会在/www文件夹中找到的所有内容。我正在尝试更新我的/www文件夹,但它从不更新,只会更新/dist文件夹。为什么会发生这种情况,为什么我的/www文件夹拒绝使用/src代码中的新更改进行更新?

我用--prod标志构建了我的应用程序几次,这可能是为什么?

标签: androidiosangularionic-frameworkcapacitor

解决方案


更改所有版本..

  • 将以下内容更改为angular-cli.json(ng1) 或angular.json(ng2+):

        "architect": {
          "build": {
            "builder": "@angular-devkit/build-angular:browser",
            "options": {
              "outputPath": "dist/dev",
            }
          }
        }
    

拥有多个位置:

  • 构建:

    ng build --output-path=dist/dev

  • 或具有多种配置:

    ng build --output-path=wwwtest --configuration test


推荐阅读