Skip to content

Commit

Permalink
Fix Code Reloading (#26)
Browse files Browse the repository at this point in the history
- make code reloading again by copying it into a temp directory
  • Loading branch information
fschoenfeldt authored Dec 2, 2024
1 parent d6ae921 commit 5f7dc8e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("src/img");
eleventyConfig.addPassthroughCopy("src/fonts");

// copy the _build folder manually to trigger a eleventy reload.
if (process.env.ELEVENTY_ENV == "development") {
eleventyConfig.addPassthroughCopy({ "src/_build/css": "css" });
eleventyConfig.addPassthroughCopy({ "src/_build/js": "js" });
}

/**
* HTML Minifier for production builds
*/
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jspm_packages/

#dev env
.vscode
src/_build/*

#Build
_site
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "Frederik Schönfeldt Website",
"scripts": {
"clean": "del _site",
"watch-css": "npx tailwindcss --postcss -i ./assets/css/styles.css -o ./_site/css/styles.css -w",
"watch-js": "npx esbuild ./assets/js/app.js ./assets/js/app_vacation.js ./assets/js/app_manager.js --outdir=./_site/js/ --bundle --target=es2018 --watch",
"watch-css": "npx tailwindcss --postcss -i ./assets/css/styles.css -o ./src/_build/css/styles.css -w",
"watch-js": "npx esbuild ./assets/js/app.js ./assets/js/app_vacation.js ./assets/js/app_manager.js --outdir=./src/_build/js/ --bundle --target=es2018 --watch",
"start": "NODE_ENV=development concurrently \"node hash\" \"ELEVENTY_ENV=development eleventy --serve\" \"npm:watch-*\"",
"start:e2e": "NODE_ENV=development concurrently \"node hash\" \"ELEVENTY_ENV=development eleventy --serve --port 8081\" \"npm:watch-*\"",
"build-css": "npx tailwindcss --postcss -i ./assets/css/styles.css -o ./_site/css/styles.css --minify",
Expand Down

0 comments on commit 5f7dc8e

Please sign in to comment.