Skip to content

Commit

Permalink
#151: + grunt jquery:min
Browse files Browse the repository at this point in the history
  • Loading branch information
RubaXa committed Dec 31, 2014
1 parent 0d162a0 commit 1e49904
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -2,4 +2,4 @@ node_modules
mock.png
.*.sw*
.build*
jquery.fn.sortable.js
jquery.fn.*
13 changes: 11 additions & 2 deletions Gruntfile.js
Expand Up @@ -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'
}
}
},

Expand All @@ -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';

Expand All @@ -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');
}
});


Expand All @@ -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']);
};
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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
Expand Down

0 comments on commit 1e49904

Please sign in to comment.