Home
Support Forums

Netlify + Eleventy + Dev Server

Hi,

I am trying to use “netlify dev” with eleventy and get this error:

netlify-demo@1.0.0 build /Users/scott/code/netlify-demo
eleventy

Writing public/index.html from ./site/index.html.
Wrote 1 file in 0.04 seconds (v0.12.1)
“npm run build” exited with code 0. Shutting down Netlify Dev server

Any idea why the dev server is shutting down? I have no problem running “netlify build”. Here is my config:

[build]
command = ‘npm run build’
publish = ‘public’

and my script definition inside package.json:

“build”: “eleventy”

Hi @scottfwalter

You may need/want to add a [dev] section to the netlify.toml with the 11ty dev command (--serve or --watch from what I have found)
E.g.

[build]
  command = "npm run build"
  publish = "public"

[dev]
  command = "npm run start" # or serve/dev/watch, depending on the scripts in package.json

Reference

2 Likes

Ahh! That did it. Thanks!