Skip to content

How to link to another javascript file #23942

Discussion options

You must be logged in to vote

Hmm it looks like you’re using npm to manage these dependencies for this project, is that right? GitHub Pages doesn’t natively support npm so it won’t install these for you when deploying your site.

When deploying a site like this you’ll usually have to install these and run your build script locally and then push the built version up to a separate branch on GitHub–usually the gh-pages branch. There’s a useful module called gh-pages that can help with this deployment part. Once you’ve done that, and pushed your code to the gh-pages branch, you’ll need to set that new branch to the publishing source of your site in the repository settings.

You’ll also need to remember to run this build & d…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants