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

workspaceDir #11074

Closed
pi0 opened this issue May 20, 2021 · 2 comments · Fixed by nuxt/framework#7439
Closed

workspaceDir #11074

pi0 opened this issue May 20, 2021 · 2 comments · Fixed by nuxt/framework#7439
Assignees

Comments

@pi0
Copy link
Member

pi0 commented May 20, 2021

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.

Copy link
Member

atinux commented May 20, 2021

Is this for internal use only or also giving the possibility for user to specify projectDir?

srcDir, rootDir and projectDir may start to be confusing but I understand the mess of the dependencies.

@pi0
Copy link
Member Author

pi0 commented May 20, 2021

Indeed. Ideally, projectDir should be correctly resolved relative to rootDir unless there is a specific setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants