glpi icon indicating copy to clipboard operation
glpi copied to clipboard

Check if minified files are still used

Open AdrienClairembault opened this issue 2 months ago • 6 comments

I think minified JS files are no longer being but they are still generated in the production archive.

Maybe we should remove them then?

AdrienClairembault avatar Dec 03 '25 15:12 AdrienClairembault

As far a I know, they're still used if they're present; see Html::getMiniFile() and FrontEndAssetExtension::jsPath().

trasher avatar Dec 03 '25 15:12 trasher

They should be used when using the js_path Twig function.

cconard96 avatar Dec 03 '25 15:12 cconard96

I haven't checked the code but I've compared two production instances:

GLPI 10 prod:

Image

GLPI 11 prod:

Image

And if I modify the common.js file on the GLPI 11 prod to add a console.log statement, it is printed in the console (which suggest the min file is not used).

So maybe there is something more to investigate here? Unless it is the prod I am testing on which may not be setup correctly.

AdrienClairembault avatar Dec 03 '25 15:12 AdrienClairembault

Is debug mode enabled?

cconard96 avatar Dec 03 '25 15:12 cconard96

Is debug mode enabled?

No

AdrienClairembault avatar Dec 03 '25 15:12 AdrienClairembault

Actually, the "file_exists" check in FrontEndAssetsExtension may be the cause if JS files are all in the public folder but referenced without that in the path.

cconard96 avatar Dec 03 '25 15:12 cconard96