Permalink
Browse files

gruntfile updates

  • Loading branch information...
1 parent a204c82 commit f166a9fcfe74dab07209181329bf1fab815b2022 @bgrins committed Apr 5, 2013
Showing with 46 additions and 35 deletions.
  1. +19 −21 Gruntfile.js
  2. +2 −3 dist/tinycolor-min.js
  3. +25 −11 package.json
View
@@ -2,24 +2,22 @@
module.exports = function(grunt) {
grunt.initConfig({
- pkg: '<json:package.json>',
+ pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '// TinyColor v<%= pkg.version %>\n' +
'// https://github.com/bgrins/TinyColor\n' +
'// <%= grunt.template.today("yyyy-mm-dd") %>, Brian Grinstead, MIT License\n'
},
- concat: {
- dist: {
- src: ['<banner:meta.banner>', 'tinycolor.js'],
- dest: 'dist/tinycolor.js'
- }
- },
-
- min: {
+ uglify: {
+ options: {
+ mangle: false,
+ banner: '<%= meta.banner %>'
+ },
dist: {
- src: ['<banner:meta.banner>', 'tinycolor.js', '\n'],
- dest: 'dist/tinycolor-min.js'
+ files: {
+ 'dist/tinycolor-min.js': ['tinycolor.js']
+ }
}
},
@@ -28,18 +26,15 @@ module.exports = function(grunt) {
},
- lint: {
- all: ['tinycolor.js']
- },
-
jshint: {
options: {
browser: true,
- sub: true
+ sub: true,
+ globals: {
+ jQuery: true
+ }
},
- globals: {
- jQuery: true
- }
+ all: ['tinycolor.js']
}
});
@@ -51,8 +46,11 @@ module.exports = function(grunt) {
});
});
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-qunit');
- grunt.registerTask('default', 'lint qunit');
- grunt.registerTask('build', 'lint qunit min docco');
+ grunt.registerTask('default', ['jshint']);
+ grunt.registerTask('build', ['jshint', 'uglify', 'docco']);
};
Oops, something went wrong.

0 comments on commit f166a9f

Please sign in to comment.