Hot reload for Elm application #6

Merged
Yehowshua merged 3 commits from nix-frontend-hot-reload into main 2025-02-02 20:58:57 +00:00
2 changed files with 3 additions and 13 deletions
Showing only changes of commit 3445273d1c - Show all commits

View file

@ -114,18 +114,8 @@
mkShell {
inputsFrom = [ example-spa-elm-app ];
buildInputs = [
nodejs_22
];
shellHook = ''
if [ ! -d "$PWD/frontend/node_modules/elm-go" ]; then
echo "Installing elm-go..."
cd "$PWD/frontend"
${nodejs_22}/bin/npm install elm-go
cd ..
fi
export PATH="$PWD/frontend/node_modules/.bin:$PATH"
'';
elmPackages.elm-live
];
};
}
);

View file

@ -21,7 +21,7 @@ endif
serve:
ifeq ($(DEBUG),1)
elm-go src/Main.elm --port=8000 --dir=../public --start-page=index.html -- --output=../public/elm.min.js
elm-live src/Main.elm --port=8000 --dir=../public --start-page=index.html -- --output=../public/elm.min.js
else ifeq ($(RELEASE),1)
$(error Cannot use serve target with RELEASE=1)
endif