Following is an example of minification using the Google Closure compiler.
• Open a Command Prompt and type Java to invoke Java.exe. You should see a list of Java options displayed. If Java.exe cannot be found download and install Java first. Then repeat this test.
• Create folder c:\temp if you don’t have one already.
• Download the Google Closure compiler from https://dl.google.com/closure-compiler/ ... latest.zip
• Extract closure-compiler-vYYYYMMDD.jar from the download zip file into folder C:\temp.
• Rename it to be compiler.jar
• Copy your JS file to be min[/b]ified into folder c:\temp. Change its name to testinput.js
• Open a Command Prompt. Change to directory c:\temp
• Copy and paste the following entire and complete command into Command Prompt window:
Java -Xmx512m -jar compiler.jar --compilation_level WHITESPACE_ONLY --js testinput.js --js_output_file testoutput.js --warning_level VERBOSE
The command should look like this:
• Press enter. The Google closure compiler should then execute and strip all white space from the testinput.js file and create new file named testoutput.js.
In theory, the minified output file can be used as a direct replacement for the input file, but you should test this.
More information at https://developers.google.com/closure/c ... tarted_app
This forum allows developers to post programming tips and coding techniques that may be useful to other Visual LANSA developers. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
1 post • Page 1 of 1