bernhard Posted February 2 Share Posted February 2 Hi everyone! I've started working on a new module that contains development tools like asset minification. Why a new module when RockFrontend and RockMigrations already have similar features? I wanted to start fresh to make the code cleaner, and most importantly make it work properly with template cache! The old implementation in RockFrontend using page render hooks simply couldn't handle that. The module is intended for development-only and should be disabled on production. The idea is to create minified assets while developing and then push the minified assets to production and there just include them in your markup! LiveReload has also been moved from RockFrontend to this module. It's simply not a frontend-tool but rather a development tool! Using RockMigrations, for example, I'm always using the LiveReload feature on the backend, so it does not really make sense to have it in the frontend module π Download & Docs: baumrock.com/RockDevTools 9 Link to comment Share on other sites More sharing options...
rastographics Posted March 1 Share Posted March 1 I set the configuration as instructed $config->rockdevtools = true. Yet still there is no config UI or evidence in the dashboard of rock dev tools anywhere besides the module install screen. I even tried commenting out the 2 lines in the module's source code that exit early if $config->rockdevtools is not true. Any ideas on troubleshooting to get this module to appear in the ui? Link to comment Share on other sites More sharing options...
bernhard Posted March 1 Author Share Posted March 1 Not sure I understand your message. RockDevTools does not provide a UI. It provides an API to minify/merge assets and it provides SSE based live reload for your local pw development. Link to comment Share on other sites More sharing options...
Stefanowitsch Posted April 4 Share Posted April 4 Hi @bernhard i have a question about porting old projects that used the asset bundling and minification from RockFrontend the new method in RockDevTools. My problem is that i get this error message on every project, after installing RockDevTools and trying to merge and minify my assets in my _init.php: Error Call to undefined function rockdevtools() My _initp.php looks like this: <?php /** * Initialization file for template files * * This file is automatically included as a result of $config->prependTemplateFile * option specified in your /site/config.php. * * You can initialize anything you want to here. In the case of this beginner profile, * we are using it just to include another file with shared functions. * */ include_once("./_func.php"); // include our shared functions if ($config->rockdevtools) { $devtools = rockdevtools(); // force recreating of minified files on every request //$devtools->debug = true; // parse all less files to css $devtools->assets() ->less() ->add('/site/templates/styles/less/uikit/_custom-import.less') ->add('/site/templates/styles/less/project/*.less') ->add('/site/templates/styles/less/custom/*.less') ->add('/site/templates/RockPageBuilder/**.less') ->add('/site/templates/RockPageBuilder/*.less') ->save('/site/templates/styles/styles.css'); // merge and minify css files $devtools->assets() ->css() ->add('/site/templates/styles/styles.css') ->save('/site/templates/styles/styles.min.css'); // merge and minify JS files $devtools->assets() ->js() ->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') ->save('/site/templates/scripts/scripts.min.js'); } Link to comment Share on other sites More sharing options...
bernhard Posted April 4 Author Share Posted April 4 Hi @Stefanowitsch the module needs to be installed otherwise the rockdevtools() function will not be available Link to comment Share on other sites More sharing options...
Stefanowitsch Posted April 4 Share Posted April 4 On 4/4/2025 at 8:43 AM, bernhard said: Hi @Stefanowitsch the module needs to be installed otherwise the rockdevtools() function will not be available Expand I have the module installed. Link to comment Share on other sites More sharing options...
bernhard Posted April 4 Author Share Posted April 4 Ok then it means you are missing the ProcessWire namespace on the _init file π I've added a note to the docs, thx. Link to comment Share on other sites More sharing options...
Stefanowitsch Posted April 4 Share Posted April 4 On 4/4/2025 at 8:48 AM, bernhard said: Ok then it means you are missing the ProcessWire namespace on the _init file π Expand This does not help either π I have the feeling this in in my case a somehow cache-related problem (if that is even possible?) after tinkering with the namespace (and removing it again) in the _init.php and the included _func.php it is working now. Even without the namespace (?). Link to comment Share on other sites More sharing options...
rastographics Posted yesterday at 01:45 AM Share Posted yesterday at 01:45 AM Sorry but I'm excited to try this module for live reload in my dev environment and I've followed the only instructions I can find (at https://github.com/baumrock/RockDevTools/tree/main/docs). 1. Install the module 2. Add $config->rockdevtools = true; to the config.php file. Now...how do I enable live reload? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now