-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to extend gatsby-config.js #15549
Comments
Would Gatsby Themes possibly help with this? You can put a base config in the theme and then when you use a theme, the site's gatsby-config is merged with any gatsby-configs from other themes. As well, as you upgrade a theme, the gatsby-config in the theme updates with it so a consumer of the theme doesn't need to touch it. Here's the docs for Themes: https://www.gatsbyjs.org/docs/themes/what-are-gatsby-themes |
Oh nice, that sounds perfect. I didn't know that was a thing. I'll look into it more, thanks! |
Alright. I'm going to close this for now as this seems to be resolved |
@lannonbr Any idea what I'm doing wrong here? I'm hoping to extend The links still do not open as expected. |
Let me open a new issue about this |
Summary
Add the ability to extend an existing
gatsby-config.js
. Any additional options added will overwrite the extended config options. Basically, the same implementation as"extends"
intsconfig.json
.Basic example
Motivation
I am creating an npm package that is essentially a template for Gatsby projects. Since it involves many plugins,
gatsby-config.js
needs to be modified for each project that uses the package. Currently the only options are to:These are poor options as any time the npm package is updated and requires a change in
gatsby-config.js
(e.g. new plugins are added, settings are changed, plugins removed, etc.), the user has to manually apply the changes themselves to their owngatsby-config.js
file.With this proposed change, users would simply need to run
npm update [package_name]
and they would immediately receive the new up-to-date configuration file.This works extremely well for packages such as Typescript and ESLint and it would be fantastic to have this feature in Gatsby.
The text was updated successfully, but these errors were encountered: