diff options
author | 2025-03-03 11:35:17 +0100 | |
---|---|---|
committer | 2025-03-03 11:35:17 +0100 | |
commit | 40a78f042b83346f595ca15daf9145c1d22c5502 (patch) | |
tree | 9d8c1dcd8ff1ee01db29bcb12bbdcbf80637b306 | |
parent | af5af2a868d9f65738e3a566684ba397737b8419 (diff) |
add `serve-frontend`
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | default.nix | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -5,6 +5,6 @@ ```console build acms serve content & -python -m http.server -d dist-newstyle/build/javascript-ghcjs/ghc-9.10.1/achat-0.1.0.0/x/frontend/build/frontend/frontend.jsexe & +serve-frontend & firefox http://localhost:8000 ``` diff --git a/default.nix b/default.nix index 39a3bd6..f3e7e05 100644 --- a/default.nix +++ b/default.nix @@ -38,6 +38,7 @@ rec { buildInputs = [ pkgs.haskell.packages.${ghc}.cabal-install pkgs.haskell.packages.${ghc}.ormolu + pkgs.python3 (pkgs.writers.writeDashBin "build-frontend" '' set -efu cabal \ @@ -45,6 +46,10 @@ rec { --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg \ build '') + (pkgs.writers.writeDashBin "serve-frontend" '' + set -efu + ${pkgs.python3}/bin/python -m http.server -d ${pkgs.lib.escapeShellArg (toString ./.)}dist-newstyle/build/javascript-ghcjs/ghc-9.10.1/achat-0.1.0.0/x/frontend/build/frontend/frontend.jsexe & + '') (pkgs.writers.writeDashBin "build-backend" '' set -efu cabal build @@ -54,7 +59,6 @@ rec { build-frontend build-backend '') - pkgs.python3 ]; shellHook = '' export EM_CACHE="${toString ./.}/.emcache" # nixos/nixpkgs#282509 |