Cleaning up the messy includes



  • Prestashop head includes are absolutely terrible. As far as I can tell every css and js file that might be used on a page somewhere is automatically loaded in every page of the site; totally ridiculous. I also see scripts that have nothing to do with the page automatically inserted into every page; even if they aren’t being used anywhere on the site. I have 50 files automatically loaded on my homepage where I really only need 49 :wink:

    I know this is an old Prestashop issue and they supposedly fixed it in 1.7 to have a better MVC structure. Will future development of TB help streamline what files are loaded on each page based on requirements of the content and possibly provide a way to minify all files?

    Thanks!


  • administrators

    Very likely, but it will take a few minor versions and increased adoption of the framework.


  • Global Moderator

    PS 1.7 tackles this by joining all the CSS and JS snippets into one big file for each. Pretty simple to do, just use a master CSS/JS file containing nothing but @include’s for the other files and use that. The webpack compiler even manages to optimize the result (options --optimize-minimize --optimize-occurence-order --optimize-dedupe).


Log in to reply
 

Looks like your connection to thirty bees forum was lost, please wait while we try to reconnect.