Answer the question
In order to leave comments, you need to log in
Parcel + gh-pages and css?
Hello! I make up a site using Parcel, I place it on github pages. The site is multi-page, when you click on a link from the menu, another page of the site opens, but css and js are not loaded. Gives 404 for the file, although the links are written in the markup and the files themselves are in the repo. Everything works fine on localhost.
Answer the question
In order to leave comments, you need to log in
Perhaps the answer is no longer needed, but I will leave it for history.
If your page is called username.github.io/new-facebook
, then you need to add a parameter --public-url
when building the project.
those. build command should look something like this -
parcel build src/index.html --public-url /new-facebook --no-content-hash
--no-content-hash
it is advisable to leave it, otherwise you will have files from past deployments in gh pages.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question