cameronm
cameronm
DDeno
Created by cameronm on 10/10/2024 in #help
nodeModulesDir with deno workspaces
Hi there, Running into an issue with deno workspaces. I have created an apps and packages directory in the root of my workspace. Inside apps I have a web directory containing a sveltekit project. I have the root deno.json setup like this
{
"workspace": ["./apps/web"],
"nodeModulesDir": "auto"
}
{
"workspace": ["./apps/web"],
"nodeModulesDir": "auto"
}
When I run deno install, from the apps/web directory, the node_modules folder gets created in the root project directory instead of the apps/web directory. If I remove the workspace config from the above code snippet like so:
{
"nodeModulesDir": "auto"
}
{
"nodeModulesDir": "auto"
}
The node_modules folder gets created in the app/web directory as expected. The documentation is a little sparse, and am wondering if this is expected behaviour. Wondering if since this folder (apps/web) is not exporting any code, only consuming from other shared packages, that it should not be included in the workspace config in root deno.json ie. workspace config should only include paths to shared packages that are exporting code.
2 replies