Get started Useful scripts
This package provides a pre-configured do folder setup that helps organize your development workflow using npm workspaces. The do folder contains scripts for building and running your Eleventy project.
Install #
- Install
/anyblades/eleventy-blades to reuse pre-defined 11ty scripts from there:
npm install @anyblades/eleventy-blades
- Create a helper folder
doto symlink thedo/package.jsonwithin:
mkdir do
cd do/
ln -s ../node_modules/@anyblades/eleventy-blades/packages/do/package.json
- Finally register
dofolder as npm workspace in your rootpackage.json:
{
...
"workspaces": ["do"],
"scripts": {
"start": "npm -w do run start",
"stage": "npm -w do run stage",
"build": "npm -w do run build"
},
...
}
Done! 🎉 Now you can run:
npm startto start 11ty dev server with live reload and Tailwind watch modenpm run stageto build and serve production-like site locallynpm run buildto finally build the site for production- all available scripts:
/anyblades/eleventy-blades/blob/main/packages/do/package.json
Live examples #
Benefits #
- Clean separation
- Keep build scripts separate from project configuration
- Reusable workflows
- Update scripts by upgrading the package
- Workspace isolation
- Scripts run in their own workspace context
- Easy maintenance
- No need to manually maintain build scripts
More #
Find and kill 11ty processes #
ps aux | grep eleventy
pkill -f eleventy
You can even combine it with other processes hanging around:
ps aux | grep -E 'eleventy|tailwind|.bin/serve'
pkill -f tailwind
pkill -f .bin/serve