Last updated Jul 16, 2024

Supporting minification of JavaScript and CSS resources


Atlassian Plugin Framework 2.3 and later.

The Atlassian Plugin Framework supports minification when serving JavaScript and CSS resources.

The aim of minification is to remove all unnecessary characters (such as white space) without affecting the functionality.

How Minification Works

For a given resource, the plugin framework will serve the minified file (* or * if present, otherwise it will serve the non-minified file.

For example, take a look at this declaration:

<web-resource key="avataror">
  <resource type="download" name="avataror.js" location="/includes/js/avataror.js">
    <param name="source" value="webContextStatic"/>
  <resource type="download" name="avataror.css" location="/styles/avataror.css">
    <param name="source" value="webContextStatic"/>

When the resource named avataror.js is requested, the system will check for a file called avataror-min.js or avataror.min.js. If either of these files exists, it will be served. Otherwise, the plugin framework it will fall back to the old behaviour of streaming the named location file.

Compressing Files in your Build

There is a Maven 2 plugin that will compress files in your build.

  <!-- Everything on one line -->
    <!-- Don't really care about warning messages. They're fairly useless -->

Disabling Minification

You can turn off minification support in your development environments, so that you serve up only non-minified files for debugging purposes:


Minification is automatically disabled in Atlassian developer mode.

Rate this page: