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.
This commit is contained in:
		
							parent
							
								
									06d2467c56
								
							
						
					
					
						commit
						3ff6ae3697
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue