I have a component which also contains a module as part of the component. In the component manifest I have, within the media element, a file joomla.asset.json which contains my preset styles etc. In my module manifest I have a media element containing folders for css and js files which has the destination of mod_mymodule but rather than duplicate the styles in the module I wanted to utilise the preset from the component. So within the module manifest I have 2 media elements, one for the standard destination of mod_mymodule and a second for destination of com_mycomponent pointing to joomla.asset.json of the component. It appears to work satisfactorily, however, is this a wise thing to do? Any and all guidance appreciated.
<media destination="mod_mymodule" folder="media">
<folder>css</folder>
<folder>js</folder>
</media>
<media destination="com_mycomponent" folder="media">
<file>joomla.asset.json</file>
</media>
joomla.asset.json
included in your installation .zip for the module that same file or a copy of thejoomla.asset.json
? I would think overwriting thejoomla.asset.json
file of one extension during the installation of another extension could lead to confusion for anyone else looking at com_mycomponent and seeing a mismatch in thejoomla.asset.json
files if they aren't aware of what is going on.