In Magento 2, is there a way, as a module developer, to share a javascript or css file between the frontend
and adminhtml
areas?
In Magento 2, your css and javascript files are kept in the following folders
app/code/Packagename/Modulename/view/frontend/web/path/to/file.js
app/code/Packagename/Modulename/view/adminhtml/web/path/to/file.js
This means, as a module developer, if I want to share a bit of javascript between the frontend and backend, I need to include it twice in my module.
Is there a built-in way to store a css/javascript file in one place, and have it included in both the frontend and backend?
If not, is there a convenient place to hook-in with a plugin or observer and manipulate [what I assume is the head block] directly?