Supporting Minification of JavaScript and CSS Resources
Available: | Atlassian Plugin Framework 2.3 and later. |
---|
The Atlassian Plugin Framework supports minification when serving JavaScript and CSS resources.
On this page:
How Minification Works
For a given resource, the plugin framework will serve the minified file (*-min.xxx
or *.min.xxx
) if present, otherwise it will serve the non-minified file.
For example, take a look at this declaration:
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.
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.