grunt-optimize-js

Optimize JavaScript with optimize-js

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
grunt-optimize-js
0.6.06 years ago6 years agoMinified + gzip package size for grunt-optimize-js in KB

Readme

grunt-optimize-js
Grunt plugin for optimize-js
Optimize JavaScript for faster initial load by wrapping all immediately-invoked functions.
dependencies Status Build Status Code Climate Known Vulnerabilities

Install

npm install grunt-optimize-js --save-dev

or
yarn add grunt-optimize-js --dev

Usage

module.exports = function( grunt ) {

    grunt.initConfig( {
        'optimize-js': {
            options: {
                sourceMap: false,
                silent: false
            },
            dist: {
                files: {
                    'dist/app.optimized.js': 'src/app.js'
                }
            }
        }
    } );

    grunt.loadNpmTasks( 'grunt-optimize-js' );

    grunt.registerTask( 'default', [ 'optimize-js' ] );

};

Options

sourceMap: true
Include source map defaults to false
silent: true
Skip the status output defaults to false