From 13998310b1c308ae05434bb038e12327a90db3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=BD=A9?= Date: Fri, 15 Dec 2017 11:00:04 +0800 Subject: [PATCH 1/2] use grunt-contrib-uglify --- Gruntfile.js | 15 +++++++++------ package.json | 5 ++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index bc1b8765..f8c94208 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -83,10 +83,13 @@ module.exports = function ( grunt ) { ext: '.min.css' } }, - closurecompiler: { - dist: { - src: disDir + '<%= pkg.name %>.js', - dest: disDir + '<%= pkg.name %>.min.js' + uglify: { + options: { + banner: banner + }, + dest: { + src: disDir + '<%= pkg.name %>.all.js', + dest: disDir + '<%= pkg.name %>.all.min.js' } }, copy: { @@ -211,14 +214,14 @@ module.exports = function ( grunt ) { grunt.loadNpmTasks('grunt-text-replace'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-closurecompiler'); + grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-transcoding'); grunt.loadNpmTasks('grunt-contrib-compress'); grunt.registerTask('default', 'UEditor Mini build', function () { - var tasks = [ 'concat', 'cssmin', 'closurecompiler', 'copy:base', 'copy:'+server, 'copy:demo', 'replace:demo' ]; + var tasks = [ 'concat', 'cssmin', 'uglify', 'copy:base', 'copy:'+server, 'copy:demo', 'replace:demo' ]; if ( encode === 'gbk' ) { tasks.push( 'replace:fileEncode' ); diff --git a/package.json b/package.json index b1d31925..3a32a233 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,4 @@ { - "name": "umeditor", "title": "umeditor", "description": "umeditor", @@ -26,7 +25,7 @@ "grunt": "~0.4.1", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-cssmin": "~0.6.0", - "grunt-closurecompiler": "~0.9.9", + "grunt-contrib-uglify": "~1.0.1", "grunt-contrib-copy": "~0.4.0", "grunt-transcoding": "~0.1.1", "grunt-text-replace": "~0.3.9", @@ -35,4 +34,4 @@ "devDependencies": { "grunt": "~0.4.1" } -} \ No newline at end of file +} From 0254df16790b0d78ff4869476577bc5489755178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=BD=A9?= Date: Fri, 15 Dec 2017 13:15:10 +0800 Subject: [PATCH 2/2] use grunt-contrib-uglify --- Gruntfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index f8c94208..1c0e9ee9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -88,8 +88,8 @@ module.exports = function ( grunt ) { banner: banner }, dest: { - src: disDir + '<%= pkg.name %>.all.js', - dest: disDir + '<%= pkg.name %>.all.min.js' + src: disDir + '<%= pkg.name %>.js', + dest: disDir + '<%= pkg.name %>.min.js' } }, copy: {