Skip to content
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

Support extends from different config file name #57

Open
DemoMacro opened this issue Feb 28, 2023 · 2 comments
Open

Support extends from different config file name #57

DemoMacro opened this issue Feb 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@DemoMacro
Copy link

Environment

node: v16.14.2
"c12": v1.1.2

Reproduction

https://stackblitz.com/edit/c12-bug-extends?file=index.mjs

Describe the bug

The extends option does not load configuration files in subdirectories, nor does it load configuration from npm packages.

❯ node index.mjs
Cannot extend config from `./base/config.dev.ts` in /home/projects/c12-bug-extends
{ config: true }

Additional context

No response

Logs

No response

@pi0
Copy link
Member

pi0 commented Feb 28, 2023

Hi. The config file in sub-directory should exist with expected name (config.ts). fixed sandbox

Is there a specific usecase you wanting to use .dev.ts in base?

@DemoMacro
Copy link
Author

Hi. The config file in sub-directory should exist with expected name (config.ts). fixed sandbox

Is there a specific usecase you wanting to use .dev.ts in base?

Changing the file name does work, but the official use case supports a similar configuration as config.dev.ts below, and it is clear that the extends option should not be restricted by naming, and any file specified as an expanded configuration should be loaded.

The following is stated in the official README and it is feasible that a configuration file of any name in a subdirectory should also be able to be loaded.

// config.ts
export default {
  colors: {
    primary: "user_primary",
  },
  extends: ["./theme", "./config.dev.ts"],
};

@pi0 pi0 changed the title The extends option does not load configuration files in subdirectories Support extends from different config file name Mar 13, 2023
@pi0 pi0 added the enhancement New feature or request label Mar 13, 2023
pi0 added a commit that referenced this issue Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants