zl程序教程

您现在的位置是:首页 >  其它

当前栏目

[Grunt] Uglify

grunt
2023-09-14 08:59:21 时间

Grunt Uglify to compress your javascript for production deployment.

 

Install


 

npm install grunt-contrib-uglify

 

Example


 

/**
 * Created by Answer1215 on 11/15/2014.
 */
module.exports = function(grunt){

    grunt.initConfig({
        uglify:{
            dist:{
                files:{
                    "dist/app.min.js": "app/**/*.js"
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
}

 

Any js files in app folder will be output as app.min.js in dist folder.