From 3ff6ae36975f1293229f27a4e60d1e1334ad6f77 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 25 Mar 2020 17:18:51 +0000 Subject: [PATCH] Use Parcel's --public-url option when building 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. --- boilerplate/typescript/default.nix | 2 +- website/goals/default.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boilerplate/typescript/default.nix b/boilerplate/typescript/default.nix index b7aaf0a57..f4d331843 100644 --- a/boilerplate/typescript/default.nix +++ b/boilerplate/typescript/default.nix @@ -11,7 +11,7 @@ pkgs.stdenv.mkDerivation { # parcel.js needs number of CPUs PARCEL_WORKERS = "1"; buildPhase = '' - npx parcel build $src/index.html + npx parcel build src/index.html --public-url ./ ''; installPhase = '' mv dist $out diff --git a/website/goals/default.nix b/website/goals/default.nix index 4337d3f0c..696b63375 100644 --- a/website/goals/default.nix +++ b/website/goals/default.nix @@ -11,7 +11,7 @@ pkgs.stdenv.mkDerivation { # parcel.js needs number of CPUs PARCEL_WORKERS = "1"; buildPhase = '' - npx parcel build src/index.html + npx parcel build src/index.html --public-url ./ ''; installPhase = '' mv dist $out