Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Minification in Javascript

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 232
    Comment on it

    Minification in Javascript:

    Minification means removing/clearing. In javacript, Minification is the process of removing all characters(i.e extra whitespace, comments, new line characters, etc.) from the javascript source code that are not necessary. This process does not change the functionality of the code. Code that has gone through the minification process is also known as minified code and hence javascript is minimized.

    How to minifest javascript:

    To minifest javascript,

    1. Try the Closure Compiler, JSMin or the YUI Compressor.
    2. Create a build process that uses these tools to minify and rename the development files and save them to a production directory.

    Installing and Configuring the Closure Compiler Minification Tool:

    1. Firstly, Download and install the Node.js runtime environment.
    2. Allow Node.js plugin enabled. The plugin is activated by default. If the plugin is not activated, enable it on the Plugins page of the Settings / Preferences Dialog .
    3. Allow file Watchers plugin enabled. The plugin is activated by default. If it is not, enable the plugin. .
    4. Download the compiled tool at https://closure-compiler.googlecode.com/files/compiler-latest.zip, or at http://dl.google.com/closure-compiler/compiler-latest.zip.
    5. Extract the archive to the folder under the Node.js.

    Installing and Configuring the YUI Compressor JS or UglifyJS Minification Tool:

    1. Download and install Node.js.
    2. Allow Node.js plugin enabled. The plugin activated by default. If the plugin is not activated, enable it on the Plugins page of the Settings / Preferences Dialog.
    3. Allow file Watchers plugin enabled. The plugin is activated by default. If it is not, enable the plugin.
    4. Download and install the JavaScript minification tool. Switch to the directory where the Node Package Manager (npm) is stored or define a path variable for it so it is available from any folder. Depending on the tool you want to use, type one of the following commands at the command line prompt:

      1. To have the YUI Compressor JS installed, type: npm install yuicompressor

      2. To have the UglifyJS installed, type: npm install uglify-js

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: