How to check the whether the javascript is minified or not

1.4k Views Asked by At

I am trying to implement minification and concatenation in my Worklight project.

I followed the steps that were given in the IBM Worklight Information Center and Concatenation is working however Minification worked.

Where to check whether the js and css files are minified or not.

1

There are 1 best solutions below

3
On BEST ANSWER

Reading materials:
Please make sure to thoroughly read these. Some of your questions are answered there (and below...).

Follow the below steps to verify minification is working for you.
This is what I've done:

  1. Created a new Worklight project, "minification"
  2. Created a new Worklight application, "testapp"
  3. Added the Mobile Web environment

    • Note: For minification and concatenation only Mobile Web and Desktop Browser environments are supported.

  4. In build-settings.xml I have added the Mobile Web environment

  5. Pointed the includes field to: **/js/testapp.js

    • Note: Use a semicolon ; to separate entries: **/js/*;testapp.css

    enter image description here

  6. Right-clicked the Mobile Web environment folder and then on Run As > Apply build settings... > Use minification to reduce the size of JavaScript and CSS files > Save and run

  7. Copied myProject\bin\testapp-mobilewebapp-1.0.wlapp to the Desktop
  8. Extracted it (it's basically a zipped file) and looked at www\default\js\testapp.js

The copyright notice is not removed (legal stuff, it's on you to remove that beforehand if you choose so), but whitespaces and comments have been removed.

Before: enter image description here

After: enter image description here