I am developing a theme for Shopify, where I have a system in place for "conditionally" loading js and css files. It works like this: in my liquid files, if some condition is fulfilled, I create a script tag with text/json type, where I represent an object with links to css and js files in my assets folder. Then I have a script before end body tag, that parses a whole document and includes those files with script and link tags (asserts them in head of the page). The ending result is, that browser is making a bunch of requests for those files. Good thing is, that I can prevent loading of scripts and styles if I don't need them. My question is, is there some technique, that can "merge" those js and css files in one file, instead of "injecting" scripts and links in html? I can't do that on deployment, because I don't know which files I will need. It would be possible to do that if I would have access to server-side rendering and filesystem, but I have to do this on runtime (Shopify is closed system). Any ideas?