If i run netlify deploy --build --prod
everything works perfectly but if i run netlify dev
function are missing and the command creates a “dist” folder in the monorepo root.
Starting from Netlify CLI version 16, all commands execute from the workspace root to replicate the build system’s behavior on Netlify. This change ensures consistency with the production build pipeline. Configurations in netlify.toml
now use absolute paths anchored to the repository root.
When using netlify dev
in a monorepo’s root directory, a site selection prompt appears, similar to the setup screen’s site picker. You can specify a particular site with --filter <site-name>
or --filter <packagePath>
flags for commands like dev
, build
, functions
, etc., to run from the root, eliminating the need to change directories.
Issues with the dist
folder location might arise due to netlify.toml
configurations. Ensure paths declared in netlify.toml
are absolute paths relative to the base directory. For instance, if netlify.toml
specifies:
[build]
publish = "dist"
command = "npm run build"
Running netlify deploy
from a package directory like services/ui-app/packages/app
resolves dist
from the monorepo root, not the package folder.
Adjust your build and deploy commands or netlify.toml
to ensure dist
is created and resolved correctly in the intended location.