Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2248

Joomla! 5.x Coding • Re: Where to put a js.map file?

$
0
0
It seems my question makes the wrong assumption, that there is a correct place to put that map.

In fact, it seems that the map can be anywhere, it just needs to be specified to Joomla.

One way to do this is to include it in the json assets file. The way I've done it is

Code:

"name":"<my component>.<entry name>","type": "script","importmap": true,"uri": "/media/<my component>/js/<map file name>","dependencies": [ "core" ],"attributes": {   "defer": true}
The ("a"?) key point is the "importmap" entry.
I don't s'pose the "dependencies" entry is required, nor perhaps the defer attribute.
It seems to require the full path in the uri, this appears to be a full path.
I also s'pose it doesn't have to be in the js directory.

I imagine this can also be done with a "registerAndUseScript" method call on the Web Asset Manager in the default.php (or whichever your file is), ie without including it in the assets file.

You're welcome.

Statistics: Posted by MarkRS — Wed Mar 27, 2024 11:29 am



Viewing all articles
Browse latest Browse all 2248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>