From: Igor Lima Date: Tue, 19 Feb 2013 18:54:53 +0000 (-0300) Subject: Update core task to grunt plugin: min task → grunt-contrib-uglify plugin X-Git-Tag: 2.1.0~55^2~3^2^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dfbcb628aae7d5cecc03de388596b9984042709;p=thirdparty%2Fmoment.git Update core task to grunt plugin: min task → grunt-contrib-uglify plugin --- diff --git a/Gruntfile.js b/Gruntfile.js index d4070a3cc..21ed6ee06 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,20 +3,17 @@ var fs = require('fs'), module.exports = function (grunt) { - var minLangs = { - langs: { - src: ['min/langs.js'], - dest: 'min/langs.min.js' - } + var minifiedFiles = { + 'min/langs.min.js' : ['min/langs.js'], + 'min/moment.min.js' : ['moment.js'] }; // all the lang files need to be added manually fs.readdirSync('./lang').forEach(function (path) { if (path.indexOf('.js') > -1) { - minLangs[path] = { - src: ['lang/' + path], - dest: 'min/lang/' + path - }; + var dest = 'min/lang/' + path, + src = ['lang/' + path]; + minifiedFiles[dest] = src; } }); @@ -28,22 +25,18 @@ module.exports = function (grunt) { dest: 'min/langs.js' } }, - minlang : minLangs, - minwithcomments : { - moment: { - src: ['moment.js'], - dest: 'min/moment.min.js' - } - }, - uglify: { - mangle: { - toplevel: true + uglify : { + my_target: { + files: minifiedFiles }, - squeeze: { - dead_code: false - }, - codegen: { - ascii_only: true + options: { + mangle: true, + squeeze: { + dead_code: false + }, + codegen: { + ascii_only: true + } } }, nodeunit : { @@ -106,5 +99,5 @@ module.exports = function (grunt) { grunt.registerTask('default', ['jshint', 'nodeunit']); // Task to be run when releasing a new version - grunt.registerTask('release', ['jshint', 'nodeunit', 'minwithcomments', 'concat', 'minlang']); + grunt.registerTask('release', ['jshint', 'nodeunit', 'concat', 'uglify']); };