I am creating a one-page application consisting only of static HTML, JS and CSS. I need to support IE9 +, modern desktop browsers and iOS 6+.
The web is built using grunt, and I'm considering embedding all of JS and CSS in an HTML file, which will simplify processing a bit.
Since there is no content created by the server and the .html page is also cached, do you see any pitfalls or flaws when embedding all JS and CSS? As far as I understand, this can even improve performance, since there are fewer hits for the browser, but maybe there are good reasons not to embed these (rather huge) files?
Do you have any experience with this?
[edit] It seems this is not entirely clear. I donβt want to manually put all the JS and CSS that I work with into the resulting HTML file. I have a clean project structure, and think about letting grunt generate the inline version as a release. I will not work with the built-in version, neither for development, nor for debugging. My question concerns only the technical part: will there be any negative impact on the browser (with the exception of caching, all html is cached, and I can live with its invalidity in general)? Why is embedding as a result of the automated build process still considered bad practice (with the exception of the caching topic)?
source share