What are the advantages and disadvantages of including JS/CSS inside the HTML instead of separated files?
Specifically concerned about performance issues, for example, if the CSS and JS are small and simple, and they are not going to be used in any other page, is it better to include them with the HTML so there is only a single request to the server? Or is this not a concern anymore with HTTP/2?
Which other technical considerations are important regarding this decision?
Best Answer
The reason why js and css will be seperated is for bundling and minification purposes.
If the file is small, it doesn't matter much. It is more of a preference.
We do have some standards from w3c. You can read them here.