This could be extracted in the standard JS module I mentioned. But on my side I think we should keep the RequireJS loader plugin to allow RequireJS modules to easily loads their icons. This loaded plugin would call the standard JS module.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.