Eleventy Plugin Baseline

A magic carpet ride

Documentation — Table of Contents

Baseline Build Scripts and Cleanup

Set up clean dev/build scripts using npm-run-all, rimraf, and cross-env so your Baseline builds are predictable across platforms.

Prerequisites

Steps

  1. Add scripts to package.json

    Ensure these are present:

    {
      "scripts": {
        "start": "npm-run-all clean dev",
        "clean": "rimraf dist/",
        "dev": "npx @11ty/eleventy --serve",
        "build:eleventy": "cross-env ELEVENTY_ENV=production npx @11ty/eleventy",
        "build": "npm-run-all clean build:*",
        "dryrun": "npx @11ty/eleventy --dryrun"
      }
    }
  2. Run local dev with clean output

    npm run start
    • Runs clean (removes dist/), then dev server.
  3. Run production build

    npm run build
    • Runs clean, then build:eleventy with ELEVENTY_ENV=production.
  4. Optional: dry run

    npm run dryrun
    • Inspect what would be built without writing files.

Notes

Previous: Integrate Baseline with Eleventy Base Blog

Next: Modules