angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.7k stars 2.19k forks source link

wrong output path for deploy #2780

Closed its-dibo closed 3 years ago

its-dibo commented 3 years ago

when I run ng build --prod and ng run server it writes the output into dist/browser and dist/server folders. but when I run ng deploy using @angular/fire:deploy, it writes the output into dist/browser/dist/browser and dist/srver/dist/server

angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "cms": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        },
        "@schematics/angular:application": {
          "strict": true
        }
      },
      "root": "projects/cms",
      "sourceRoot": "projects/cms/browser",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {

            "outputPath": "dist/cms/core/browser",
            "index": "projects/cms/browser/index.html",
            "main": "projects/cms/browser/main.ts",
            "polyfills": "projects/cms/browser/polyfills.ts",
            "tsConfig": "projects/cms/browser/tsconfig.json",
            "aot": true,
            "assets": [
              "projects/cms/browser/favicon.ico",
              "projects/cms/browser/assets"
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
              "projects/cms/browser/styles.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "projects/cms/config/env.ts",
                  "with": "projects/cms/config/env.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "500kb",
                  "maximumError": "1mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "500kb",
                  "maximumError": "1mb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "cms:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "cms:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "cms:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "projects/cms/browser/test.ts",
            "polyfills": "projects/cms/browser/polyfills.ts",
            "tsConfig": "projects/cms/tsconfig.spec.json",
            "karmaConfig": "projects/cms/karma.conf.js",
            "assets": [
              "projects/cms/browser/favicon.ico",
              "projects/cms/browser/assets"
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
              "projects/cms/browser/styles.scss"
            ],
            "scripts": []
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "projects/cms/browser/tsconfig.json",
              "projects/cms/tsconfig.spec.json",
              "projects/cms/e2e/tsconfig.json",
              "projects/cms/server/tsconfig.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        },
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "projects/cms/e2e/protractor.conf.js",
            "devServerTarget": "cms:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "cms:serve:production"
            }
          }
        },
        "server": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {           
            "outputPath": "dist/cms/core/server",
            "main": "projects/cms/server/express.ts",
            "tsConfig": "projects/cms/server/tsconfig.json",
            "externalDependencies": [
              "firebase",
              "@firebase/app",
              "@firebase/analytics",
              "@firebase/auth",
              "@firebase/component",
              "@firebase/database",
              "@firebase/firestore",
              "@firebase/functions",
              "@firebase/installations",
              "@firebase/messaging",
              "@firebase/storage",
              "@firebase/performance",
              "@firebase/remote-config",
              "@firebase/util"
            ]
          },
          "configurations": {
            "production": {
              "outputHashing": "media",
              "fileReplacements": [
                {
                  "replace": "projects/cms/config/env.ts",
                  "with": "projects/cms/config/env.prod.ts"
                }
              ],
              "sourceMap": false,
              "optimization": true
            }
          }
        },
        "serve-ssr": {
          "builder": "@nguniversal/builders:ssr-dev-server",
          "options": {
            "browserTarget": "cms:build",
            "serverTarget": "cms:server"
          },
          "configurations": {
            "production": {
              "browserTarget": "cms:build:production",
              "serverTarget": "cms:server:production"
            }
          }
        },
        "prerender": {
          "builder": "@nguniversal/builders:prerender",
          "options": {
            "browserTarget": "cms:build:production",
            "serverTarget": "cms:server:production",
            "routes": [
              "/"
            ]
          },
          "configurations": {
            "production": {}
          }
        },
        "deploy": {
          "builder": "@angular/fire:deploy",
          "options": {
            "ssr": true
          }
        }
      }
    },
    "sample": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        },
        "@schematics/angular:application": {
          "strict": true
        }
      },
      "root": "projects/sample",
      "sourceRoot": "projects/sample/src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/sample",
            "index": "projects/sample/src/index.html",
            "main": "projects/sample/src/main.ts",
            "polyfills": "projects/sample/src/polyfills.ts",
            "tsConfig": "projects/sample/tsconfig.app.json",
            "aot": true,
            "assets": [
              "projects/sample/src/favicon.ico",
              "projects/sample/src/assets"
            ],
            "styles": [
              "projects/sample/src/styles.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "projects/sample/src/environments/environment.ts",
                  "with": "projects/sample/src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "500kb",
                  "maximumError": "1mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "2kb",
                  "maximumError": "4kb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "sample:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "sample:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "sample:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "projects/sample/src/test.ts",
            "polyfills": "projects/sample/src/polyfills.ts",
            "tsConfig": "projects/sample/tsconfig.spec.json",
            "karmaConfig": "projects/sample/karma.conf.js",
            "assets": [
              "projects/sample/src/favicon.ico",
              "projects/sample/src/assets"
            ],
            "styles": [
              "projects/sample/src/styles.scss"
            ],
            "scripts": []
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "projects/sample/tsconfig.app.json",
              "projects/sample/tsconfig.spec.json",
              "projects/sample/e2e/tsconfig.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        },
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "projects/sample/e2e/protractor.conf.js",
            "devServerTarget": "sample:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "sample:serve:production"
            }
          }
        }
      }
    }
  },
  "defaultProject": "cms"
}
google-oss-bot commented 3 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

stefanedberg commented 3 years ago

I'm having the same issue.

jamesdaniels commented 3 years ago

Added in 7.1.0-rc.0, there's now an outputPath option for the deploy command that isn't horrible :P e.,g set it to dist/functions. It will have a good default out of the box for fresh ng add @angular/fire@next but I didn't break prior behavior.