Skip to content

workspaceDir #11074

@pi0

Description

@pi0

For the conditions that nuxt app is not in the root of workspace/repository directory, often issues happen. Currently, we have an internal modulesDir option that helps to resolve this by creating a list of directories looking for node_modules (and by default process.cwd() is added to this list) but it is neither explicit or solving all cases.

Related issues:

Vite tries to find root by looking up for pnpm-workspace.yaml or a package.json with workspaces key but it is not enough since there are conditions user is not using a monorepo workspace but simply have nuxt app in a sub-directory. (https://vitejs.dev/config/#server-fsserve-root)

We can implement this by looking up (from rootDir) for first package.lock, package-lock.json or package.json that has workspaces key (unless there is a package.json in rootDir?) and falling back to rootDir if couldn't find. and also giving users ability to customize it with a nuxt option.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions