Browse Source

#151: + grunt jquery:min

issue-210
RubaXa 10 years ago
parent
commit
1e499042bd
  1. 2
      .gitignore
  2. 13
      Gruntfile.js
  3. 2
      README.md

2
.gitignore vendored

@ -2,4 +2,4 @@ node_modules
mock.png mock.png
.*.sw* .*.sw*
.build* .build*
jquery.fn.sortable.js jquery.fn.*

13
Gruntfile.js

@ -24,6 +24,11 @@ module.exports = function (grunt) {
files: { files: {
'<%= pkg.exportName %>.min.js': ['<%= pkg.exportName %>.js'] '<%= 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'), var fs = require('fs'),
filename = 'jquery.fn.sortable.js'; 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') .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('meteor', ['meteor-test', 'meteor-publish']);
grunt.registerTask('tests', ['jshint']); grunt.registerTask('tests', ['jshint']);
grunt.registerTask('default', ['tests', 'version', 'uglify']); grunt.registerTask('default', ['tests', 'version', 'uglify:dist']);
}; };

2
README.md

@ -438,7 +438,7 @@ To assemble plugin for jQuery, perform the following steps:
grunt jquery 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 ```js
$("#list").sortable({ /* options */ }); // init $("#list").sortable({ /* options */ }); // init

Loading…
Cancel
Save