grunt.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. module.exports = function (grunt) {
  2. grunt.initConfig({
  3. coffee: {
  4. lib: {
  5. src: ['build/morris.coffee'],
  6. dest: '.',
  7. options: { bare: false }
  8. },
  9. spec: {
  10. src: ['build/spec.coffee'],
  11. dest: 'build',
  12. options: { bare: true }
  13. }
  14. },
  15. concat: {
  16. 'build/morris.coffee': [
  17. 'lib/morris.coffee',
  18. 'lib/morris.grid.coffee',
  19. 'lib/morris.hover.coffee',
  20. 'lib/morris.line.coffee',
  21. 'lib/morris.area.coffee',
  22. 'lib/morris.bar.coffee',
  23. 'lib/morris.donut.coffee'
  24. ],
  25. 'build/spec.coffee': ['spec/support/**/*.coffee', 'spec/lib/**/*.coffee']
  26. },
  27. less: {
  28. all: {
  29. src: 'less/*.less',
  30. dest: 'morris.css',
  31. options: {
  32. compress: true
  33. }
  34. }
  35. },
  36. min: {
  37. 'morris.min.js': 'morris.js'
  38. },
  39. mocha: {
  40. spec: {
  41. src: 'spec/specs.html',
  42. run: true
  43. }
  44. },
  45. watch: {
  46. files: ['lib/**/*.coffee', 'spec/lib/**/*.coffee', 'spec/support/**/*.coffee', 'less/**/*.less'],
  47. tasks: 'default'
  48. }
  49. });
  50. grunt.loadNpmTasks('grunt-coffee');
  51. grunt.loadNpmTasks('grunt-mocha');
  52. grunt.loadNpmTasks('grunt-contrib-less');
  53. grunt.registerTask('default', 'concat coffee less min mocha');
  54. };