I am currently in the process of attempting to convert an existing Jira Cloud addon to a Jira Server addon.
In an effort to share as much code as possible across the two I’ve taken an architectural approach of making a new directory in my Jira Server project where I have a node/babel/webpack project (same as my Cloud addon) that bundles JS. The thought is that I will copy over JS from my Cloud addon and try and reuse as much as possible using the Jira Server REST API.
I have succeeded in implementing this but have run into an issue. My bundled JS makes it onto the Jira dashboard but it seems like the default babel JS that is included in any bundle causes conflicts with Jira’s JS on the page - specifically moment.js.
If I were to not use babel/webpack, my code would end up drastically diverging from the Cloud addon, rendering the whole approach mostly useless.
Has anyone run into this issue before? Is there a way to namespace or isolate the babel bundle code so it doesn’t conflict with Jira’s built-in JS? Maybe there is a better architectural approach that I’m unaware of?