I’m in the process of porting my Cloud and Server apps from pure vanilla .js to multiple ES6 .js modules. Primarily I’m looking to create re-usable components between generalPages, reports, dashboards etc.
From a cloud (Connect) perspective, this is fairly straight forward; just add ‘type=module’ to your main .js script and you’re off to the races.
However, I’m unsure of what the equivalent is in the server (SDK) space. In the atlassian-plugin.xml file the ‘type’ variable is already declared as ‘download’ when listing .js resources, example below:
<web-resource key="jira-basic-view-resources" name="jira-basic-view Web Resources"> <dependency>com.atlassian.auiplugin:ajs</dependency> <resource type="download" name="foo.js" location="/js/foo.js"/> <context>jira-basic-view</context> </web-resource>
Is there a way to properly declare .js resources as an ES6 module? Ideally I’d like to avoid using transpilers like webpack if possible, and I’ve already tried implementing frontend-maven-plugin but for the life of me couldn’t get it running.