Skip to content

Firebase config overwrites unrelated keys #374

@ralphsmith80

Description

@ralphsmith80

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Output production on hosting key options

If the current behavior is a bug, please provide the steps to reproduce.
With an existing firebase.json file:
npm run serve -- --server config --dest .

What is the expected behavior?
The file is merged only overriding the hosting key. A deep merge of the hosting key might be even better, but I don't know that it's really needed.

Merged firebase.json:

{
  "database": {
    "rules": "database.rules.json"
  },
  "hosting": {
    "public": "build",
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ],
    "headers": [
      {
        "source": "**",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "public, max-age=3600, no-cache"
          },
          {
            "key": "Access-Control-Allow-Origin",
            "value": "*"
          },
          {
            "key": "Access-Control-Max-Age",
            "value": "600"
          }
        ]
      },
      {
        "source": "/sw.js",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "private, no-cache"
          }
        ]
      },
      {
        "source": "**/*.chunk.*.js",
        "headers": [
          {
            "key": "Cache-Control",
            "value": "public, max-age=31536000"
          }
        ]
      },
      {
        "source": "/",
        "headers": [
          {
            "key": "Link",
            "value":
              "</bundle.6acb8.js>; rel=preload; as=script, </style.ba975.css>; rel=preload; as=style, </route-home.chunk.8111b.js>; rel=preload;as=script"
          }
        ]
      }
    ]
  }
}

If this is a feature request, what is motivation or use case for changing the behavior?
When using CI/CD pipelines like Gitlab pipelines this config is going to change when the pipeline runs and should therefore be an automatable. In my case I also have a top level database key that I don't want overridden.

Please mention other relevant information.

  • node version
    8.4.0
  • npm version
    5.3.0
  • Operating system
    mac sierra 10.12.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions