Set breakpoints for merge?
-
I have a site on which there is a common “shell” — header, navigation, footer, reset styles, etc. — but also each page has a lot of its own JS and CSS that’s unique to each page.
If I enqueue all the styles for the site on every page, that means effectively all the styles and scripts for the whole site have to load, even the stuff for pages that a user never visits.
But if I enqueue only the styles for the current page, part of each each page’s merged file contains a duplicate of all the common site-wide stuff.
Is there a way to tell MMR, before enqueueing the page’s JS and CSS, to start a new merge file, so that all the site-wide stuff will end up in one merge file that can be served on every page, and all the page-specific stuff ends up in a separate file for each page?
The topic ‘Set breakpoints for merge?’ is closed to new replies.