• 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?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author launchinteractive

    (@launchinteractive)

    Hi Thomas,

    At the moment the best way to do this is to turn off merging. If your host has HTTP2 enabled then it shouldn’t slow you down too much.

    One thing we could do is add a filter to give you the ability to restrict which files should merge but that would involve extra work from the developer. Would this be something you would use?

    Thread Starter thomasperi

    (@thomasperi)

    Thanks for your quick reply, and thanks for your offer of a new feature! I do like the idea of being able to exclude certain files, but turning off merging will do the trick, so don’t add a feature just for me. 😉

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Set breakpoints for merge?’ is closed to new replies.