Hey there.
I want to extend the JS class, and need access to the referenced file, which (I guess) would be something like this:
$stuff = new Asset($src)
or does $src
already ‘contain’ the file?
Question 2:
I’d like to extract some info from the file (eg hash it) and then save the output as new script $attr. What’s preferable: extending component/JS with: class MyCustomJSComponent extends Kirby\Component\JS { /* code goes here */ }
(I’d like to assign a new name to my function, but buildin on JS component functionality) by merging my new attribute with the $attr
array?
And furthermore, how can I achieve this while preserving the @auto functionality / array-wise insertion of multiple assets, adding my custom attribute to each generated script tag?