Running "netlify dev" uses the settings under the "build" section of "netlify.toml"

I’ve scoured the docs and forum, and I’ve even consulted the Netlify AI assistant; but I can’t get this to work as desired. Here’s my directory structure…

I simply want to use the netlify directory while developing and debugging and the dist directory for deployment. I have a build script that processes the contents of netlify and outputs it to dist. That works fine.

The problem is that when I invoke the netlify dev CLI command, it uses the files in the dist directory, which is not what I want for debugging. What I want instead is to use the unprocessed files in the netlify directory.

Here’s my netlify.toml file…

[dev]
    port = 8888

[functions]
    directory = "dist/functions"

[build]
    edge_functions = "dist/edge-functions"

[[edge_functions]]
    function = "cache"
    path = "/cache/*"

[[edge_functions]]
    function = "transform"
    path = "/*"
    excludedPath = "/webhook"
    cache = "manual"

What am I missing or misunderstanding?
:confused:

Here’s what the AI assistant told me, but it doesn’t work…

:confused:

EDIT

It’s still unclear if this is a bug or an AI hallucination, but I worked around the issue by writing precommand and postcommand shell scripts that actually modify the netlify.toml file by replacing and then restoring the relevant path strings. For example…

precommand && netlify build && postcommand

AI is indeed hallucinating there as there’s no built-in way to have a separate directory for (Edge) Functions only in dev mode.