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
Labels |
Added:
No Code Attached Yet
|
Title |
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-05-20 07:23:51 |
Closed_By | ⇒ | Fedik |
@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?
@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'
)
You can use full path already.
About Debug, it already was requested, check this #34228 and #34244.
Closing as duplicate.