Skip to content

Sanity Build in monorepo: checking for non-existing, local package.json #644

@JaapWeijland

Description

@JaapWeijland

Hi there,

I've scaffolded Sanity Studio in a subdirectory inside my monorepo. When I run npx sanity build, it first checks whether all required dependencies are installed by looking into the package.json file. However, because of the nature of my monorepo, I don't want package.json files to live on app level directories, only on the root directory. So I've deleted this local package.json file and moved all deps to the root one. This causes the CLI to break, since it is looking for the package.json file in the root of the studio directory. I think this line causes the issue:

https://github.com/sanity-io/sanity/blob/e62906f32bd8fafbbf61665c8705621246589707/packages/sanity/src/_internal/cli/util/checkRequiredDependencies.ts#L31

Is it possible to look for another package.json file? Is it possible to not check for dependencies at all, and just assume they're all there? Currently I can't get npx sanity build to run without it looking for a local package.json.

Thanks!

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