This is an example of source maps transformer for JIRA JavaScript files.


This is a example tool for developers which adds mapping statements to your files.
The plugin assumes that you have your JavaScript files minimized and source maps generated
(If you are new to source maps see: https://wiki.mozilla.org/DevTools/Features/SourceMap)
during the process of compilation (eg. another JIRA Plugin). Using this transformer in your
atlassian-plugin.xml will allow you to map from minimized file to source file during development in browsers which
support source maps (Chrome, Firefox Nightly)


Install jira-source-map plugin in JIRA. Add transformer in atlassian-plugin.xml of a plugin you develop:

    <web-resource key="your-jira-plugin-resources">

        <transformation extension="js">
            <transformer key="sourceMapTransformer"/>

        <resource type="download" name="your-file-min.js" location="js/your-file-min.js"/>
        <resource type="download" name="your-file-min.js.map" location="js/your-file-min.js.map"/>


Remember to enable source maps in your browser.

Known problems:

Check if your source map refers to a right file.
Sometimes generator create a file with something like :


and this may not be seen by browser, to fix this change it to: