Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid jquery based libraries from renaming during js resource compression

butt.umer1
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 5, 2018

Hi,
I am trying to develop a JIRA plugin (WebWork Item) in which I need to include a jQuery based plugin. Everything works fine and as expected if I disable Resource Compression using :


 <compressResources>false</compressResources>

 

But the moment I turn it ON it tries to rename the main function name (which I use to initialize my plugin) due to which my javascript code is unable to instantiate the plugin (since it has been renamed to some short variable name during resource compression process).

 

After further exploration, I found that JIRA uses YUI compiler for compression of resources. I have worked previously with YUI compiler and there was a parameter named "externs" which was used to specify the external dependencies for that particular file which is being compressed so that the compiler does not rename the function calls which are defined outside the script file.

 

Can anyone please let me know how we can achieve this in JIRA plugin.

Thanks

0 answers

Suggest an answer

Log in or Sign up to answer