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