Gruntfile.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. module.exports = function(grunt) {
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. meta: {
  5. banner: '// TinyColor v<%= pkg.version %>\n' +
  6. '// https://github.com/bgrins/TinyColor\n' +
  7. '// <%= grunt.template.today("yyyy-mm-dd") %>, Brian Grinstead, MIT License\n'
  8. },
  9. uglify: {
  10. options: {
  11. mangle: true,
  12. banner: '<%= meta.banner %>'
  13. },
  14. dist: {
  15. files: {
  16. 'dist/tinycolor-min.js': ['tinycolor.js']
  17. }
  18. }
  19. },
  20. qunit: {
  21. all: ['test/index.html']
  22. },
  23. jshint: {
  24. options: {
  25. browser: true,
  26. sub: true,
  27. },
  28. all: ['tinycolor.js']
  29. },
  30. docco: {
  31. debug: {
  32. src: ['tinycolor.js'],
  33. options: {
  34. output: 'docs/'
  35. }
  36. }
  37. }
  38. });
  39. grunt.loadNpmTasks('grunt-contrib-uglify');
  40. grunt.loadNpmTasks('grunt-contrib-jshint');
  41. grunt.loadNpmTasks('grunt-contrib-qunit');
  42. grunt.loadNpmTasks('grunt-docco');
  43. grunt.registerTask('default', ['jshint', 'qunit']);
  44. grunt.registerTask('version-bump', ['jshint', 'qunit', 'uglify', 'docco']);
  45. };