❌

Reading view

There are new articles available, click to refresh the page.

Running 11ty and PHP concurrently

Now that I have several sections of this site served dynamically using PHP I've finally put together a single command to work on the site locally.

This command depends on the concurrently to run multiple commands at the same time (hence the name). I've added two commands to accomplish this:

"watch": "eleventy --watch",

Which watches and updates files without running 11ty's dev server and:

"dev": "concurrently -k -n 11ty,PHP -c cyan,magenta \"npm run watch\" \"npm run php\"",

Which β€” you guessed it β€” runs both commands together (and also allows them to be quit together). 11ty output is displayed alongside [11ty] in cyan and PHP output is displayed alongside [PHP] in magenta. One consistent command for local dev, with a single server (PHP's) pointed at the built output.

❌