From db35a25ea0ca49adf2a0fcfd3ae48b7f324fc0e9 Mon Sep 17 00:00:00 2001 From: giteaadmin Date: Mon, 8 Sep 2025 10:44:07 -0400 Subject: [PATCH] fix: improve dev env --- .eleventy.js | 4 +++- package.json | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index b5d2a62..9a80f89 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -70,12 +70,14 @@ module.exports = function(eleventyConfig) { changeOrigin: true, }), ], + // Watch for changes to the compiled CSS and reload the browser. + // This is more efficient than `addWatchTarget` which triggers a full rebuild. + watch: ['_site/css/style.css'], }); } // Watch the Tailwind config file for changes eleventyConfig.addWatchTarget("./tailwind.config.js"); - eleventyConfig.addWatchTarget("_site/css/style.css"); return { // Set the source and output directories diff --git a/package.json b/package.json index 0369033..1f1d327 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "An Eleventy project with Docker and VS Code debugging.", "scripts": { "prestart": "npm run build:css", - "start": "npm-run-all -p watch:eleventy watch:css dev:api", - "watch:eleventy": "eleventy --watch", + "start": "npm-run-all -p serve:eleventy watch:css dev:api", + "serve:eleventy": "eleventy --serve", "watch:css": "tailwindcss -i ./src/css/input.css -o ./_site/css/style.css --watch", "dev:api": "node --watch server.js", "build": "npm run build:css && eleventy",