What is the best and most effecient way to include a JavaScript file or stylesheet on every page of a website? For example, if I had a script that I included for analytics, I would want to have this script in every page of the website. I could just manually go through all my files and add it, but this could try tedious if I had a lot of files, and I might forget to add all the needed scripts when I created a new file.
If you only use HTML and JS you won't get around doing it manually. You could write some .js file which loads the other styles and scripts you're intrested in to 'bundle' the imports into one file. However if you have any kind of backend you should setup some template that has the files included or a function that includes them.