grunt.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. module.exports = function(grunt) {
  2. // Project configuration.
  3. grunt.initConfig({
  4. pkg: '<json:package.json>',
  5. meta: {
  6. file: "lungo",
  7. name: 'JavaScript Hooker',
  8. banner: '/*! <%= meta.name %> - <%= grunt.template.today("m/d/yyyy") %> */'
  9. },
  10. resources: {
  11. coffee: ['src/**/*.coffee'],
  12. stylus: ['stylesheets/**/*.styl'],
  13. js: ['build/src/**/*.js'],
  14. css: ['src/**/*.coffee']
  15. },
  16. coffee: {
  17. app: {
  18. src: ['<config:resources.coffee>'],
  19. dest: 'build',
  20. options: {
  21. bare: true,
  22. preserve_dirs: true
  23. // base_path: 'javascript'
  24. }
  25. }
  26. },
  27. stylus: {
  28. compile: {
  29. options: {
  30. compress: true
  31. // paths: ['path/to/import', 'another/to/import']
  32. },
  33. files: {
  34. 'dist/<%=meta.file%>.css': ['stylesheets/**/*.styl']
  35. }
  36. },
  37. flatten: {
  38. options: {
  39. flatten: true
  40. },
  41. files: {
  42. 'build/css/theme.default.css': ['stylesheets/**/*.styl']
  43. }
  44. }
  45. },
  46. concat: {
  47. js: {
  48. src: ['<banner>', '<config:resources.js>'],
  49. dest: 'dist/<%=meta.file%>.js'
  50. }
  51. },
  52. min: {
  53. js: {
  54. src: ['<banner>', 'dist/<%=meta.file%>.js'],
  55. dest: 'dist/<%=meta.file%>.min.js'
  56. }
  57. },
  58. watch: {
  59. files: ['<config:resources.coffee>', '<config:resources.stylus>'],
  60. tasks: 'coffee concat'
  61. },
  62. uglify: {}
  63. });
  64. grunt.loadNpmTasks('grunt-coffee');
  65. grunt.loadNpmTasks('grunt-contrib-stylus');
  66. // Default task.
  67. grunt.registerTask('default', 'coffee stylus concat min');
  68. };