J
J
Julia2020-01-03 23:44:28
GitHub
Julia, 2020-01-03 23:44:28

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

1 answer(s)
D
Dima, 2020-02-10
@timonbandit

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-urlwhen 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-hashit 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 question

Ask a Question

731 491 924 answers to any question