Skip to content

Commit

Permalink
gruntfile updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrins committed Apr 5, 2013
1 parent a204c82 commit f166a9f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 35 deletions.
40 changes: 19 additions & 21 deletions Gruntfile.js
Expand Up @@ -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']
}
}
},

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

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

};

0 comments on commit f166a9f

Please sign in to comment.