Hot reload for Elm application #6
12
flake.nix
12
flake.nix
|
@ -114,18 +114,8 @@
|
||||||
mkShell {
|
mkShell {
|
||||||
inputsFrom = [ example-spa-elm-app ];
|
inputsFrom = [ example-spa-elm-app ];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
nodejs_22
|
elmPackages.elm-live
|
||||||
];
|
];
|
||||||
|
|
||||||
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"
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -21,7 +21,7 @@ endif
|
||||||
|
|
||||||
serve:
|
serve:
|
||||||
ifeq ($(DEBUG),1)
|
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)
|
else ifeq ($(RELEASE),1)
|
||||||
$(error Cannot use serve target with RELEASE=1)
|
$(error Cannot use serve target with RELEASE=1)
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue