Title: ng deploy - allow configuration for serverTarget · Issue #2764 · angular/angularfire · GitHub
Open Graph Title: ng deploy - allow configuration for serverTarget · Issue #2764 · angular/angularfire
X Title: ng deploy - allow configuration for serverTarget · Issue #2764 · angular/angularfire
Description: Version info Angular: 11.0.0 Firebase: 8.1.2 AngularFire: 6.1.4 Node: 14 How to reproduce these conditions I have two environment configs for my Angular Universal app: dev.environment.ts and prod.environment.ts with different API keys. I...
Open Graph Description: Version info Angular: 11.0.0 Firebase: 8.1.2 AngularFire: 6.1.4 Node: 14 How to reproduce these conditions I have two environment configs for my Angular Universal app: dev.environment.ts and prod.e...
X Description: Version info Angular: 11.0.0 Firebase: 8.1.2 AngularFire: 6.1.4 Node: 14 How to reproduce these conditions I have two environment configs for my Angular Universal app: dev.environment.ts and prod.e...
Opengraph URL: https://github.com/angular/angularfire/issues/2764
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ng deploy - allow configuration for serverTarget","articleBody":"\u003c!--\r\n\r\nIMPORTANT! YOU MUST FOLLOW THESE INSTRUCTIONS OR YOUR ISSUE WILL BE CLOSED.\r\n\r\nThank you for contributing to the Angular and Firebase communities!\r\n\r\nHave a usage question?\r\n=======================\r\nWe get lots of those and we love helping you, but GitHub is not the best place for them and they will be closed. Here are some resources to get help:\r\n\r\n- Go through the Developer's Guide: https://github.com/angular/angularfire2#developer-guide\r\n\r\nIf the official documentation doesn't help, try asking through our officially supported channels:\r\n\r\n- Firebase Google Group: https://groups.google.com/forum/#!forum/firebase-talk\r\n- Stack Overflow: https://stackoverflow.com/questions/tagged/angular (include the firebase and angularfire tags, too!)\r\n\r\n*Please avoid double posting across multiple channels!*\r\n\r\nThink you found a bug?\r\n=======================\r\nYeah, we're definitely not perfect! Please use the bug report template below and include a minimal repro when opening the issue.\r\n\r\nHave a feature request?\r\n========================\r\nGreat, we love hearing how we can improve our products! Remove the template below and\r\nprovide an explanation of your feature request. Provide code samples if applicable. Try to\r\nthink about what it will allow you to do that you can't do today? How will it make current\r\nworkarounds straightforward? What potential bugs and edge cases does it help to avoid?\r\n\r\n--\u003e\r\n\r\n\r\n### Version info\r\n\r\n\u003c!-- What versions of the following libraries are you using? Note that your issue may already\r\nbe fixed in the latest versions. --\u003e\r\n\r\n**Angular:** 11.0.0\r\n\r\n**Firebase:** 8.1.2\r\n\r\n**AngularFire:** 6.1.4\r\n\r\n**Node:** 14\r\n\r\n### How to reproduce these conditions\r\nI have two environment configs for my Angular Universal app: `dev.environment.ts` and `prod.environment.ts` with different API keys. I configured my entire `angular.json` for these two build configurations `production` and `development`. However, when I run `ng deploy --configuration development` the browser build uses the correct configuration, but the server build uses the `production` config.\r\n\r\n**Steps to set up and reproduce**\r\n\r\n```json\r\n{\r\n \"$schema\": \"./node_modules/@angular/cli/lib/config/schema.json\",\r\n \"version\": 1,\r\n \"newProjectRoot\": \"projects\",\r\n \"projects\": {\r\n \"my-app\": {\r\n \"projectType\": \"application\",\r\n \"schematics\": {\r\n \"@schematics/angular:component\": {\r\n \"style\": \"scss\",\r\n \"skipTests\": true\r\n },\r\n \"@schematics/angular:class\": {\r\n \"skipTests\": true\r\n },\r\n \"@schematics/angular:directive\": {\r\n \"skipTests\": true\r\n },\r\n \"@schematics/angular:guard\": {\r\n \"skipTests\": true\r\n },\r\n \"@schematics/angular:interceptor\": {\r\n \"skipTests\": true\r\n },\r\n \"@schematics/angular:module\": {\r\n \"skipTests\": true\r\n },\r\n \"@schematics/angular:pipe\": {\r\n \"skipTests\": true\r\n },\r\n \"@schematics/angular:service\": {\r\n \"skipTests\": true\r\n }\r\n },\r\n \"root\": \"\",\r\n \"sourceRoot\": \"src\",\r\n \"prefix\": \"app\",\r\n \"architect\": {\r\n \"build\": {\r\n \"builder\": \"@angular-devkit/build-angular:browser\",\r\n \"options\": {\r\n \"allowedCommonJsDependencies\": [\r\n \"hammerjs\",\r\n \"lodash/cloneDeep\",\r\n \"@angular/fire/firestore\",\r\n \"@firebase/app\",\r\n \"@firebase/auth\",\r\n \"@firebase/firestore\",\r\n \"@firebase/component\",\r\n \"@firebase/util\",\r\n \"@firebase/performance\",\r\n \"firebase/app\",\r\n \"jspdf\",\r\n \"pako\",\r\n \"@babel/runtime-corejs3\",\r\n \"raf\"\r\n ],\r\n \"outputPath\": \"dist/browser\",\r\n \"index\": \"src/index.html\",\r\n \"main\": \"src/main.ts\",\r\n \"polyfills\": \"src/polyfills.ts\",\r\n \"tsConfig\": \"tsconfig.app.json\",\r\n \"aot\": true,\r\n \"assets\": [\r\n \"src/favicon.ico\",\r\n \"src/apple-touch-icon.png\",\r\n \"src/assets\",\r\n \"src/manifest.webmanifest\"\r\n ],\r\n \"styles\": [\r\n \"src/styles.scss\"\r\n ],\r\n \"stylePreprocessorOptions\": {\r\n \"includePaths\": [\r\n \"src/assets/scss\"\r\n ]\r\n },\r\n \"scripts\": []\r\n },\r\n \"configurations\": {\r\n \"production\": {\r\n \"fileReplacements\": [\r\n {\r\n \"replace\": \"src/environments/environment.ts\",\r\n \"with\": \"src/environments/environment.prod.ts\"\r\n }\r\n ],\r\n \"index\": {\r\n \"input\": \"src/index.prod.html\",\r\n \"output\": \"index.html\"\r\n },\r\n \"optimization\": true,\r\n \"outputHashing\": \"all\",\r\n \"sourceMap\": false,\r\n \"namedChunks\": false,\r\n \"extractLicenses\": true,\r\n \"vendorChunk\": false,\r\n \"buildOptimizer\": true,\r\n \"budgets\": [\r\n {\r\n \"type\": \"initial\",\r\n \"maximumWarning\": \"2mb\",\r\n \"maximumError\": \"5mb\"\r\n },\r\n {\r\n \"type\": \"anyComponentStyle\",\r\n \"maximumWarning\": \"7kb\",\r\n \"maximumError\": \"10kb\"\r\n }\r\n ],\r\n \"serviceWorker\": true,\r\n \"ngswConfigPath\": \"ngsw-config.json\"\r\n },\r\n \"development\": {\r\n \"fileReplacements\": [\r\n {\r\n \"replace\": \"src/environments/environment.ts\",\r\n \"with\": \"src/environments/environment.dev.ts\"\r\n }\r\n ],\r\n \"optimization\": true,\r\n \"outputHashing\": \"all\",\r\n \"sourceMap\": false,\r\n \"namedChunks\": false,\r\n \"extractLicenses\": true,\r\n \"vendorChunk\": false,\r\n \"buildOptimizer\": true,\r\n \"budgets\": [\r\n {\r\n \"type\": \"initial\",\r\n \"maximumWarning\": \"2mb\",\r\n \"maximumError\": \"5mb\"\r\n },\r\n {\r\n \"type\": \"anyComponentStyle\",\r\n \"maximumWarning\": \"7kb\",\r\n \"maximumError\": \"10kb\"\r\n }\r\n ],\r\n \"serviceWorker\": true,\r\n \"ngswConfigPath\": \"ngsw-config.json\"\r\n }\r\n }\r\n },\r\n \"serve\": {\r\n \"builder\": \"@angular-devkit/build-angular:dev-server\",\r\n \"options\": {\r\n \"browserTarget\": \"my-app:build\"\r\n },\r\n \"configurations\": {\r\n \"production\": {\r\n \"browserTarget\": \"my-app:build:production\"\r\n },\r\n \"development\": {\r\n \"browserTarget\": \"my-app:build:development\"\r\n }\r\n }\r\n },\r\n \"extract-i18n\": {\r\n \"builder\": \"@angular-devkit/build-angular:extract-i18n\",\r\n \"options\": {\r\n \"browserTarget\": \"my-app:build\"\r\n }\r\n },\r\n \"test\": {\r\n \"builder\": \"@angular-devkit/build-angular:karma\",\r\n \"options\": {\r\n \"main\": \"src/test.ts\",\r\n \"polyfills\": \"src/polyfills.ts\",\r\n \"tsConfig\": \"tsconfig.spec.json\",\r\n \"karmaConfig\": \"karma.conf.js\",\r\n \"assets\": [\r\n \"src/favicon.ico\",\r\n \"src/apple-touch-icon.png\",\r\n \"src/assets\",\r\n \"src/manifest.webmanifest\"\r\n ],\r\n \"styles\": [\r\n \"src/styles.scss\"\r\n ],\r\n \"stylePreprocessorOptions\": {\r\n \"includePaths\": [\r\n \"src/assets/scss\"\r\n ]\r\n },\r\n \"scripts\": []\r\n }\r\n },\r\n \"lint\": {\r\n \"builder\": \"@angular-eslint/builder:lint\",\r\n \"options\": {\r\n \"lintFilePatterns\": [\r\n \"src/**/*.ts\",\r\n \"src/**/*.html\"\r\n ]\r\n }\r\n },\r\n \"e2e\": {\r\n \"builder\": \"@angular-devkit/build-angular:protractor\",\r\n \"options\": {\r\n \"protractorConfig\": \"e2e/protractor.conf.js\",\r\n \"devServerTarget\": \"my-app:serve\"\r\n },\r\n \"configurations\": {\r\n \"production\": {\r\n \"devServerTarget\": \"my-app:serve:production\"\r\n },\r\n \"development\": {\r\n \"devServerTarget\": \"my-app:serve:development\"\r\n }\r\n }\r\n },\r\n \"deploy\": {\r\n \"builder\": \"@angular/fire:deploy\",\r\n \"options\": {\r\n \"ssr\": true,\r\n \"functionsNodeVersion\": 12\r\n },\r\n \"configurations\": {\r\n \"production\": {\r\n \"buildTarget\": \"my-app:build:production\",\r\n \"serverTarget\": \"my-app:server:production\"\r\n },\r\n \"development\": {\r\n \"buildTarget\": \"my-app:build:development\",\r\n \"serverTarget\": \"my-app:server:development\"\r\n }\r\n }\r\n },\r\n \"server\": {\r\n \"builder\": \"@angular-devkit/build-angular:server\",\r\n \"options\": {\r\n \"outputPath\": \"dist/server\",\r\n \"main\": \"server.ts\",\r\n \"tsConfig\": \"tsconfig.server.json\",\r\n \"stylePreprocessorOptions\": {\r\n \"includePaths\": [\r\n \"src/assets/scss\"\r\n ]\r\n },\r\n \"externalDependencies\": [\r\n \"firebase\",\r\n \"@firebase/app\",\r\n \"@firebase/analytics\",\r\n \"@firebase/auth\",\r\n \"@firebase/component\",\r\n \"@firebase/database\",\r\n \"@firebase/firestore\",\r\n \"@firebase/functions\",\r\n \"@firebase/installations\",\r\n \"@firebase/messaging\",\r\n \"@firebase/storage\",\r\n \"@firebase/performance\",\r\n \"@firebase/remote-config\",\r\n \"@firebase/util\"\r\n ]\r\n },\r\n \"configurations\": {\r\n \"production\": {\r\n \"outputHashing\": \"media\",\r\n \"fileReplacements\": [\r\n {\r\n \"replace\": \"src/environments/environment.ts\",\r\n \"with\": \"src/environments/environment.prod.ts\"\r\n }\r\n ],\r\n \"sourceMap\": false,\r\n \"optimization\": true\r\n },\r\n \"development\": {\r\n \"outputHashing\": \"media\",\r\n \"fileReplacements\": [\r\n {\r\n \"replace\": \"src/environments/environment.ts\",\r\n \"with\": \"src/environments/environment.dev.ts\"\r\n }\r\n ],\r\n \"sourceMap\": false,\r\n \"optimization\": true\r\n }\r\n }\r\n },\r\n \"serve-ssr\": {\r\n \"builder\": \"@nguniversal/builders:ssr-dev-server\",\r\n \"options\": {\r\n \"browserTarget\": \"my-app:build\",\r\n \"serverTarget\": \"my-app:server\"\r\n },\r\n \"configurations\": {\r\n \"production\": {\r\n \"browserTarget\": \"my-app:build:production\",\r\n \"serverTarget\": \"my-app:server:production\"\r\n },\r\n \"development\": {\r\n \"browserTarget\": \"my-app:build:development\",\r\n \"serverTarget\": \"my-app:server:development\"\r\n }\r\n }\r\n },\r\n \"prerender\": {\r\n \"builder\": \"@nguniversal/builders:prerender\",\r\n \"options\": {\r\n \"browserTarget\": \"my-app:build:production\",\r\n \"serverTarget\": \"my-app:server:production\",\r\n \"routes\": [\r\n \"/\"\r\n ]\r\n },\r\n \"configurations\": {\r\n \"production\": {},\r\n \"development\": {}\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"defaultProject\": \"my-app\"\r\n}\r\n```\r\n\r\n### Expected behavior\r\n\r\nUse correct environment for both the browser- and the server build.\r\n\r\n### Actual behavior\r\n\r\nThe browser build uses the correct config from the `dev.environment.ts`, but the server build uses the `prod.environment.ts`.\r\n","author":{"url":"https://github.com/lukfel","@type":"Person","name":"lukfel"},"datePublished":"2021-02-23T16:33:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/2764/angularfire/issues/2764"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:396e3c08-4612-a485-341b-3d3ea900c614 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 81A8:3FF3CA:3D54F76:54D44A9:6A60F2FD |
| html-safe-nonce | cccd1510cb631ca8d814143b57477cc641c31011e7b1ae62bb84d35dae1cb739 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUE4OjNGRjNDQTozRDU0Rjc2OjU0RDQ0QTk6NkE2MEYyRkQiLCJ2aXNpdG9yX2lkIjoiMjQ0NTM1MTQ4NTg3MjA3NTUxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6c8ee9ca8b1f872d710d426ca82c025d258e16cc1438df620d6ae273a9b7b736 |
| hovercard-subject-tag | issue:814628157 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/2764/issue_layout |
| twitter:image | https://opengraph.githubassets.com/863966738fec896e4435acec7b60d8bc77d592273621375cb326f786580e7300/angular/angularfire/issues/2764 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/863966738fec896e4435acec7b60d8bc77d592273621375cb326f786580e7300/angular/angularfire/issues/2764 |
| og:image:alt | Version info Angular: 11.0.0 Firebase: 8.1.2 AngularFire: 6.1.4 Node: 14 How to reproduce these conditions I have two environment configs for my Angular Universal app: dev.environment.ts and prod.e... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lukfel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01a0f3379195d313175de239776b09dd4a079d5b2ea29dd9c37e85cd4cd5e990 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 00ca1a9089c8f2453e5d118d0554c8a26883d159 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width