Jump to content

Combine RPB resources such as JS and CSS


herr rilke
 Share

Recommended Posts

hi there,

so i wonder if there's a way to combine all these resources (as the minifiy option in rockfrondend) and to avoid the many roundups for each css or js-file and make them cachable as well:

 

  <link href='/site/templates/bundle/main.min.css?m=1737183638' rel='stylesheet'>
  <link href='/site/modules/RockFields/assets/RockPageBuilder.min.css?m=1728917624' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Accordion/Accordion.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Accordion/Accordion.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/ArtikelMitBild/ArtikelMitBild.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/ArtikelMitBild/ArtikelMitBild.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Hero/Hero.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Hero/Hero.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Text/Text.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Text/Text.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/styles/admin.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/styles/admin.min.css?m=1731931045' rel='stylesheet'>
  <link href='/site/templates/styles/main.min.css?m=1732860349' rel='stylesheet'>
  <link href='/site/templates/styles/main.min.css?m=1732860349' rel='stylesheet'>
  <link href='/site/templates/less/_global.min.css?m=1732859882' rel='stylesheet'>
  <link href='/site/templates/less/_global.min.css?m=1732859882' rel='stylesheet'>
  <link href='/site/templates/webfonts/webfonts.min.css?m=1731931045' rel='stylesheet'>
  <script src='/site/templates/uikit/dist/js/uikit.min.js?m=1727317894'></script>
  <script src='/site/templates/uikit/dist/js/uikit-icons.min.js?m=1727317894'></script>
  <script src='/site/templates/scripts/main.min.js?m=1731931045' defer></script>

best

karsten

Link to comment
Share on other sites

good morning,

i have something like

image.thumb.png.d2a060e122ffd689a3fd0eed49b29904.png

 

+ minify option of RF enabled

and i get the following, where LESS seems to be compiled but CSS still injected:

<head>
  <meta charset="UTF-8">

  <title>Home | QualiGuide</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!--
  <link rel="stylesheet" type="text/css" href="/site/templates/styles/main.css" />
  <script src="/site/templates/scripts/main.js"></script>
-->
  <title>Home</title>
  <meta property="og:title" content="Home | QualiGuide.de">
  <meta name="description" content="Home">
  <meta property="og:description" content="Home">
  <link rel="canonical" href="http://domain/">
  
  <link rel="icon" type="image/png" href="/site/templates/styles/favicon/favicon-48x48.png" sizes="48x48" />
  <link rel="icon" type="image/svg+xml" href="/site/templates/styles/favicon/favicon.svg" />
  <link rel="shortcut icon" href="/site/templates/styles/favicon/favicon.ico" />
  <link rel="apple-touch-icon" sizes="180x180" href="/site/templates/styles/favicon/apple-touch-icon.png" />
  <meta name="apple-mobile-web-app-title" content="QualiGuide" />
  <link rel="manifest" href="/site/templates/styles/favicon/site.webmanifest" crossorigin="use-credentials" />
 
  <!-- StylesArray 'main' -->
  <!-- These comments are only visible when $config->debug = true; -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Accordion/Accordion.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/ArtikelMitBild/ArtikelMitBild.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/CallToAction/CallToAction.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Features/Features.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Gallery/Gallery.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Hero/Hero.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Quotes/Quotes.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Spalten/Spalten.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Text/Text.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/uikit/src/less/uikit.theme.less (_init.php:13) -->
  <!-- loading /site/modules/RockFrontend/less/defaults.less (_init.php:14) -->
  <!-- loading /site/templates/less/_global.less (_init.php:15) -->
  <!-- loading /site/templates/less/_variables.less (_init.php:15) -->
  <link href='/site/templates/bundle/main.min.css?m=1737356437' rel='stylesheet'>
  <link href='/site/modules/RockFields/assets/RockPageBuilder.min.css?m=1728917625' rel='stylesheet'><!-- RockPageBuilder.module.php:440 -->
  <link href='/site/templates/RockPageBuilder/blocks/Accordion/Accordion.min.css?m=1737183931' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Accordion/Accordion.min.css?m=1737183931' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/ArtikelMitBild/ArtikelMitBild.min.css?m=1737183931' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/ArtikelMitBild/ArtikelMitBild.min.css?m=1737183931' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/Hero/Hero.min.css?m=1737183931' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Hero/Hero.min.css?m=1737183931' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/Text/Text.min.css?m=1737183931' rel='stylesheet'>
  <link href='/site/templates/RockPageBuilder/blocks/Text/Text.min.css?m=1737183931' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/styles/admin.min.css?m=1737183931' rel='stylesheet'>
  <link href='/site/templates/styles/admin.min.css?m=1737183931' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/styles/main.min.css?m=1737183931' rel='stylesheet'>
  <link href='/site/templates/styles/main.min.css?m=1737183931' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/less/_global.min.css?m=1737183931' rel='stylesheet'>
  <link href='/site/templates/less/_global.min.css?m=1737183931' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/webfonts/webfonts.min.css?m=1737183931' rel='stylesheet'>
  <!-- ScriptsArray 'main' -->
  <!-- These comments are only visible when $config->debug = true; -->
  <script src='/site/templates/uikit/dist/js/uikit.min.js?m=1727317894'></script><!-- _init.php:19 -->
  <script src='/site/templates/uikit/dist/js/uikit-icons.min.js?m=1727317894'></script><!-- _init.php:20 -->
  <script src='/site/templates/scripts/main.min.js?m=1737183931' defer></script>
</head>

also wondering why css references are inserted twice.

 

 

  • Like 1
Link to comment
Share on other sites

12 minutes ago, herr rilke said:
/site/modules/RockFields/assets/RockPageBuilder.min.css

Why is your RPB folder named RockFields and not RockPageBuilder? It might not be related to this issue, but it might cause others, so I'd recommend to change that! I'll have to look into your issue. It's definitely not what it should do.

I think it might be related to the minify option. Can you try disabling that and report the result?

Link to comment
Share on other sites

ok,

wondering, why minification is still on, but found in _init.php

<?php
namespace ProcessWire;

include_once(__DIR__ . '/_functions.php');


/** @var RockFrontend $rockfrontend */

$htmlLang = "de";

$rockfrontend->styles()
  ->add('/site/templates/uikit/src/less/uikit.theme.less')
  ->add('/site/modules/RockFrontend/less/defaults.less')
  ->addDefaultFolders()
  ->minify(true);

$rockfrontend->scripts()
  ->add('/site/templates/uikit/dist/js/uikit.min.js')
  ->add('/site/templates/uikit/dist/js/uikit-icons.min.js') 
  ->add('/site/templates/scripts/main.js', 'defer')
  ->minify(true); 

$seo = $rockfrontend->seo(createManifest: false)
  ->title($page->title .... 

setting minify(false) results in:

... 

<link rel='stylesheet' href='/site/modules/RockFrontend/topbar/topbar.min.css?m=1730134652'><script>var RockFrontend = {"rootUrl":"\/","defaultVspaceScale":"0.66"}</script>  <!-- StylesArray 'main' -->
  <!-- These comments are only visible when $config->debug = true; -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Accordion/Accordion.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/ArtikelMitBild/ArtikelMitBild.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/CallToAction/CallToAction.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Features/Features.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Gallery/Gallery.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Hero/Hero.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Quotes/Quotes.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Spalten/Spalten.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/RockPageBuilder/blocks/Text/Text.less (RockPageBuilder.module.php:193) -->
  <!-- loading /site/templates/uikit/src/less/uikit.theme.less (_init.php:13) -->
  <!-- loading /site/modules/RockFrontend/less/defaults.less (_init.php:14) -->
  <!-- loading /site/templates/less/_global.less (_init.php:15) -->
  <!-- loading /site/templates/less/_variables.less (_init.php:15) -->
  <link href='/site/templates/bundle/main.css?m=1737361090' rel='stylesheet'><!-- LESS compiled by RockFrontend -->
  <link href='/site/modules/RockFields/assets/RockPageBuilder.min.css?m=1728917625' rel='stylesheet'><!-- RockPageBuilder.module.php:440 -->
  <link href='/site/modules/RockFields/assets/frontend-loggedin.min.css?m=1728917625' rel='stylesheet'><!-- RockPageBuilder.module.php:447 -->
  <link href='/site/templates/RockPageBuilder/blocks/Accordion/Accordion.css?m=1728929117' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/Accordion/Accordion.min.css?m=1737183931' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/ArtikelMitBild/ArtikelMitBild.css?m=1729433195' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/ArtikelMitBild/ArtikelMitBild.min.css?m=1737183931' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/Hero/Hero.css?m=1729243731' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/Hero/Hero.min.css?m=1737183931' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/Text/Text.css?m=1729321204' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/RockPageBuilder/blocks/Text/Text.min.css?m=1737183931' rel='stylesheet'><!-- RockPageBuilder.module.php:193 -->
  <link href='/site/templates/styles/admin.css?m=1731420429' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/styles/admin.min.css?m=1737183931' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/styles/main.css?m=1732860276' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/styles/main.min.css?m=1737183931' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/less/_global.css?m=1732810062' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/less/_global.min.css?m=1737183931' rel='stylesheet'><!-- _init.php:15 -->
  <link href='/site/templates/webfonts/webfonts.css?m=1728940414' rel='stylesheet'><!-- _init.php:15 -->
  <!-- StylesArray 'rockfrontend' -->
  <!-- These comments are only visible when $config->debug = true; -->
  <link href='/site/modules/RockFrontend/Alfred.css?m=1730133700' rel='stylesheet'><!-- RockFrontend.module.php:490 -->
  <!-- ScriptsArray 'main' -->
  <!-- These comments are only visible when $config->debug = true; -->
  <script src='/site/modules/RockFields/lib/Sortable.min.js?m=1728917625'></script><!-- RockPageBuilder.module.php:445 -->
  <script src='/site/modules/RockFields/assets/frontend-loggedin.min.js?m=1728924165'></script><!-- RockPageBuilder.module.php:446 -->
  <script src='/site/templates/uikit/dist/js/uikit.min.js?m=1727317894'></script><!-- _init.php:19 -->
  <script src='/site/templates/uikit/dist/js/uikit-icons.min.js?m=1727317894'></script><!-- _init.php:20 -->
  <script src='/site/templates/scripts/main.js?m=1722353958' defer></script><!-- _init.php:21 -->
  <!-- ScriptsArray 'rockfrontend' -->
  <!-- These comments are only visible when $config->debug = true; -->
  <script src='/site/modules/RockFrontend/Alfred.min.js?m=1730133700' defer></script><!-- RockFrontend.module.php:339 -->
</head>

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...