From 1e499042bd24eb8b00048011372868cd2689c8ed Mon Sep 17 00:00:00 2001 From: RubaXa Date: Wed, 31 Dec 2014 16:55:12 +0300 Subject: [PATCH] #151: + grunt jquery:min --- .gitignore | 2 +- Gruntfile.js | 13 +++++++++++-- README.md | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 883687b..434cfa9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules mock.png .*.sw* .build* -jquery.fn.sortable.js +jquery.fn.* diff --git a/Gruntfile.js b/Gruntfile.js index f7ac7e6..0f1db6c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -24,6 +24,11 @@ module.exports = function (grunt) { files: { '<%= pkg.exportName %>.min.js': ['<%= pkg.exportName %>.js'] } + }, + jquery: { + files: { + 'jquery.fn.sortable.min.js': 'jquery.fn.sortable.js' + } } }, @@ -40,7 +45,7 @@ module.exports = function (grunt) { }); - grunt.registerTask('jquery', function () { + grunt.registerTask('jquery', function (arg) { var fs = require('fs'), filename = 'jquery.fn.sortable.js'; @@ -54,6 +59,10 @@ module.exports = function (grunt) { .replace(/^[\s\S]*?function[\s\S]*?(var[\s\S]+)\/\/\s+Export[\s\S]+/, '$1') ) ); + + if (arg === 'min') { + grunt.task.run('uglify:jquery'); + } }); @@ -68,5 +77,5 @@ module.exports = function (grunt) { grunt.registerTask('meteor', ['meteor-test', 'meteor-publish']); grunt.registerTask('tests', ['jshint']); - grunt.registerTask('default', ['tests', 'version', 'uglify']); + grunt.registerTask('default', ['tests', 'version', 'uglify:dist']); }; diff --git a/README.md b/README.md index 9969443..46b68c8 100644 --- a/README.md +++ b/README.md @@ -438,7 +438,7 @@ To assemble plugin for jQuery, perform the following steps: grunt jquery ``` -Now you can use `jquery.fn.sortable.js`: +Now you can use `jquery.fn.sortable.js` (or `jquery.fn.sortable.min.js` if you run `grunt jquery:min`): ```js $("#list").sortable({ /* options */ }); // init