How to link to another javascript file #23942
-
Hello there I’m new to using Github pages and I’m having trouble getting an important dependency to work. I have the dependency source code and I have tried linking to that file as I did in my ide which worked there but not on Github is there a certain path that Github uses or am I doing something wrong? Code I used:
Git Repo:github.comKoolKreator/AudiomotionMusicMixerContribute to KoolKreator/AudiomotionMusicMixer development by creating an account on GitHub. Github Pages Site: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
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 You’ll also need to remember to run this build & deploy process each time you make a change to your code! |
Beta Was this translation helpful? Give feedback.
-
Thank you for your help I will try that out, also if I have the source code available would it be possible to use the dependency that way as well |
Beta Was this translation helpful? Give feedback.
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 calledgh-pages
that can help with this deployment part. Once you’ve done that, and pushed your code to thegh-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…