Short description of issue
{% stylesheet %} and {% javascript %} tags include all code from all instances, instead of what’s actually used on the page.
Reproduction steps
Create a bunch of sections, snippets and block files, then add some code inside {% stylesheet %} and {% javascript %} Liquid tags.
Visit a page on the storefront that only includes one of the sections, snippets or blocks that you did this with.
You’ll see that Shopify has included external JS and CSS files, but these contain ALL the JS and CSS that’s been defined for the whole theme, using those Liquid tags.
Additional info
This seems horribly inefficient, and therefore not how I was expecting the feature to work.
I was expecting Shopify to only include the code in the external CSS and JS files that are actually required for that page.
What type of topic is this
Bug report