-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
workspaceDir #11074
Description
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:
- feat(nitro): allow custom module directories framework#132
- [CF] External dependencies outside root folder not found (monorepo) bridge#123
- fix(vercel): Handle case where nuxt instance isn't at root of deployment image#235
- feat: vite 2.3 vite#138
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.