Skip to content

Add mergeConfig option to opt out of implicit config object merging#536

Open
swseverance wants to merge 1 commit into
firebase:masterfrom
swseverance:feature/no-merge
Open

Add mergeConfig option to opt out of implicit config object merging#536
swseverance wants to merge 1 commit into
firebase:masterfrom
swseverance:feature/no-merge

Conversation

@swseverance
Copy link
Copy Markdown

When a plain object is passed as config via the programmatic API, superstatic merges it with any superstatic.json or firebase.json found on disk. Add mergeConfig: false to use the provided object as-is.

This only affects programmatic usage — the CLI always uses the specified config file directly and was never subject to merging.

Resolves #503

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a mergeConfig option to Superstatic, allowing users to provide a configuration object that is not merged with existing superstatic.json or firebase.json files. The changes include updates to the configuration loader, middleware options, and documentation, along with new unit tests. Feedback identifies a potential bug where mergeConfig: false incorrectly handles file paths, and suggests a logic adjustment and an additional test case to ensure correct behavior.

Comment thread src/loaders/config-file.js Outdated
Comment thread test/unit/loaders/config-file.spec.js
When a plain object is passed as config via the programmatic API,
superstatic merges it with any superstatic.json or firebase.json found
on disk. Add mergeConfig: false to use the provided object as-is.

This only affects programmatic usage — the CLI always uses the specified
config file directly and was never subject to merging.

Resolves firebase#503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

superstatic always loads configs from existing firebase.json file on project root

1 participant