I am currently using this method in the index.html file; however, I want my javascript in a separate file, not inline.
<script> ... my code </script>
After some research, I see there are server side includes which appear outdated but I'm not sure.
There are also templating engines for express.
And thirdly, I imagine there is some way to concatenate the file using node libraries.
And fourthly, there are build tools such as webpack and grunt. I am currently using webpack.
How can I parse all these options, and select the best one.
The most conventional method people use is the 'src' attribute, which allows you to specify the URL of an external script file. Syntax:
<script type='text/javascript' src='./path/to/your/script.js'/>