Skip to content

Add option to specify config path #643

@austinbiggs

Description

@austinbiggs

Is your feature request related to a problem? Please describe.
I'm trying to configure an Nx monorepo to house multiple Sanity studio instances. However, there's no way to specify the path to the config file; for my setup these are nested under apps/<project-name>. This results in Sanity looking for a sanity.config.* in the root of my repo, rather than the project folder where I organize my schemas.

Describe the solution you'd like
I'd like to request the ability to set a --config flag to resolve a custom path when provided.

Describe alternatives you've considered
Alternatives that I've tried are running sanity commands from the apps current working directory, however, this doesn't work as the monorepo dependencies are installed in the root of the repo, rather than at the project level. This is because Nx strongly recommends that dependencies be managed in a single, root package.json.

I believe that the changes needed could be applied here:

  1. Add the logic for reading the config argument - sanity/cli/src/util/getCliConfig.ts
  2. Add the config argument - @sanity/cli/src/util/parseArguments.ts

Additional context
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions