If a resolved configuration contains an extends key, c12 will load and merge those additional layers. This supports nested extensions and multiple sources.
Local extensions
Items in extends can be absolute or relative paths to a config file or a directory.
// config.ts
export default {
colors: { primary: "user_primary" },
extends: ["./theme"],
};
Remote extensions
To extend from remote sources (GitHub, GitLab, Bitbucket, or HTTPS), you must install the giget peer dependency:
npx nypm install giget
Remote sources are identified by prefixes like gh:, gl:, bb:, or https:.
// Extend from a github repository
export default {
extends: "gh:user/repo",
};
// Extend with branch and subpath
export default {
extends: "gh:user/repo/theme#dev",
};
// Extend a private repository with auth and dependency installation
export default {
extends: ["gh:user/repo", { auth: process.env.GITHUB_TOKEN, install: true }],
};
// config.ts
export default {
extends: "gh:user/repo",
};