Eleventy build command - is "npx @11ty/eleventy" correct?

So I got my site up and running pretty quickly, but it took me a little while to find a suitable build command for eleventy since it wasn’t listed on this page: https://docs.netlify.com/configure-builds/common-configurations/#javascript-spas

Clearly everything can’t be listed there, but it looks as though certain tools are configured out of the box, and are ready to go? I’ve not run one of those builds, so maybe they do use the whole caching mechanism for Node etc. (or for whatever’s required of them), but if that’s not the case and they are OOTB, is there a similar option for Eleventy or should I just stick with using: npx @11ty/eleventy for now? Only reason I ask is I want the moon on a stick, and < 1 second build time instead of a 1 minute build time :stuck_out_tongue:

Hi, welcome! Actually, I think Eleventy is configured out of the box. You can use eleventy or DEBUG=* eleventy (for more detailed logs) as a build command. If you want to set up a netlify.toml file it would look like this:

[build]
  publish = "_site"
  command = "DEBUG=* eleventy"

Just gave that a whirl, but it failed to build, and then I realised I didn’t have a package.json either because I’d been using a global install on my local machine. So sorted that out and the above worked - takes about the same time but at least it means it’s no longer dependent on UI settings!

1 Like