No Code Attached Yet
avatar AndNovAtor
AndNovAtor
10 May 2022

As for Joomla 4.x WebAssetManager is useed for importing any assets, css and js, I discovered (only today), that Joomla always import a minified asset file instead of "full" file; for example, when importing with registerAndUseStyle.

libraries\src\HTML\HTMLHelper.php "tells" to use minified version, in addFileToBuffer:1226. And HTMLHelper "support" only JDEBUG as force using original path - only when FULL site is in the debug mode. (I understand, that there are no additional variables passed in registerAndUseStyle body when "resolving" an asset path.)

For me, still noob with Joomla 4 version, it's barely unattended behavior (still it's very smart and good for default behavior ), I when I SPECIFICALLY specified the asset path as a "full file" (I don't want use my PC memory [especially when there is little free RAM left] and my time for pressing "pretty print" in a browser).

Only "way" now - temporarily rename a minified file

avatar AndNovAtor AndNovAtor - open - 10 May 2022
avatar joomla-cms-bot joomla-cms-bot - change - 10 May 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 May 2022
avatar AndNovAtor AndNovAtor - change - 10 May 2022
The description was changed
avatar AndNovAtor AndNovAtor - edited - 10 May 2022
avatar AndNovAtor AndNovAtor - change - 10 May 2022
The description was changed
avatar AndNovAtor AndNovAtor - edited - 10 May 2022
avatar AndNovAtor AndNovAtor - change - 20 May 2022
Title
[4.x] Add abbility register an asset (js or css) with force using "full" file, "disable" importing minified instead
[4.x] [Feature request] Add abbility to register an asset (js or css) with force using "full" file, "disable" importing minified instead
avatar AndNovAtor AndNovAtor - edited - 20 May 2022
avatar Fedik Fedik - change - 20 May 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-05-20 07:23:51
Closed_By Fedik
avatar Fedik Fedik - close - 20 May 2022
avatar Fedik
Fedik - comment - 20 May 2022

You can use full path already.
About Debug, it already was requested, check this #34228 and #34244.

Closing as duplicate.

avatar AndNovAtor
AndNovAtor - comment - 20 May 2022

@Fedik, Ok, but PR is dead and was even created BEFORE J4 released, and now 4.1.x, still have this unintended behaviour (also, that issue special case about component/etc., my - about template).

Old (even the second) PR is dead, so in what issue I need to do "bump" and resume discussion?

avatar AndNovAtor
AndNovAtor - comment - 20 May 2022

@Fedik, ogh, I didn't understand "full path" phrase. Now saw (again) this in related issue. Yup, it's works, thank you.
For the history, example:
$wa->registerAndUseStyle("bootstrap4", Uri::root().$cur_template_path.'/css/bootstrap.css',["version" => ""]);
(instead of simply $cur_template_path or Uri::root(false).'/templates/test/css/test.css')

Add a Comment

Login with GitHub to post a comment