You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. module.exports = function(grunt) {
  2. "use strict";
  3. grunt.initConfig({
  4. pkg: grunt.file.readJSON('package.json'),
  5. jshint: {
  6. files: ['Gruntfile.js', 'tasks/**/*.js', 'test/**/*.js'],
  7. options: {
  8. jshintrc: ".jshintrc"
  9. }
  10. },
  11. watch: {
  12. files: '<%= jshint.files %>',
  13. tasks: 'default'
  14. },
  15. csslint: {
  16. valid: 'test/valid.css',
  17. empty: 'test/empty.css',
  18. all: 'test/*.css'
  19. },
  20. cssmin: {
  21. plain: {
  22. src: 'test/valid.css',
  23. dest: 'valid.min.css'
  24. },
  25. banner: {
  26. options: {
  27. banner: '/* <%= pkg.name %> - v<%= pkg.version %> - my awesome css banner */'
  28. },
  29. src: 'test/valid.css',
  30. dest: 'valid.min.banner.css'
  31. }
  32. }
  33. });
  34. // Load local tasks.
  35. grunt.loadTasks('tasks');
  36. grunt.loadNpmTasks('grunt-contrib-jshint');
  37. // Default task. csslint:all will fail, that's okay until there's unit tests
  38. grunt.registerTask('default', ['jshint', 'csslint:valid', 'csslint:empty'] );
  39. grunt.registerTask('all', ['jshint', 'cssmin', 'csslint'] );
  40. };