framework
framework copied to clipboard
Allow specifying multiple configuration files, use it to simplify example configurations
I implemented the layered config idea I sketched out in https://github.com/observablehq/framework/pull/1390#issuecomment-2127933059. This allows the --config
option to be passed multiple times. The passed configs are merged together before normalization to produce a final configuration. Configuration files can also be functions that take the current config spec as input.
With that done, I used it to simplify the examples. I removed all the common boiler plate that was marked as "feel free to remove this" and moved it to a single file at examples/common/confing.js
. To build the examples for deploy now we would run (from the specific example's directory).
yarn build --config ./observablehq.config.js --config ../common/config.js
This approach would replace #1390 and #1389 if we provide a way to specify deploy info or deploy config paths in the main config.