3ff6ae3697
By default Parcel prefixes output paths with /. So when Chrome loads wpcarro.dev/goals it attempts to get the CSS and JS and other assets from wpcarro.dev/ instead of wpcarro.dev/goals/. Using the --public-url ./ option makes Parcel output relative paths, which should work better for my needs.
19 lines
356 B
Nix
19 lines
356 B
Nix
{ pkgs, ... }:
|
|
|
|
pkgs.stdenv.mkDerivation {
|
|
name = "goals-webpage";
|
|
srcs = ./.;
|
|
buildInputs = with pkgs; [
|
|
nodejs
|
|
# Exposes lscpu for parcel.js
|
|
utillinux
|
|
];
|
|
# parcel.js needs number of CPUs
|
|
PARCEL_WORKERS = "1";
|
|
buildPhase = ''
|
|
npx parcel build src/index.html --public-url ./
|
|
'';
|
|
installPhase = ''
|
|
mv dist $out
|
|
'';
|
|
}
|