grunt.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. module.exports = function(grunt) {
  2. // Project configuration.
  3. grunt.initConfig({
  4. pkg: '<json:packages/lungo/component.json>',
  5. meta: {
  6. file: "lungo",
  7. banner: '/* <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("m/d/yyyy") %>\n' +
  8. ' <%= pkg.homepage %>\n' +
  9. ' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
  10. ' - Licensed <%= _.pluck(pkg.license, "type").join(", ") %> */'
  11. },
  12. resources: {
  13. stylesheets: ['src/**/*.styl']
  14. },
  15. stylus: {
  16. compile: {
  17. options: { compress: true, paths: ['src/stylesheets/import'] },
  18. files: {
  19. 'packages/lungo/<%=meta.file%>.css': ['src/**/Lungo.*.styl']
  20. }
  21. },
  22. flatten: {
  23. options: { flatten: true },
  24. files: {
  25. 'packages/lungo/**.css': ['src/**/theme**.styl']
  26. }
  27. }
  28. },
  29. concat: {
  30. js: {
  31. src: ['<config:resources.js>'],
  32. dest: 'package/<%=meta.file%>.js'
  33. }
  34. },
  35. min: {
  36. js: {
  37. src: ['<banner>', 'package/<%=meta.file%>.js'],
  38. dest: 'package/<%=meta.file%>.min.js'
  39. }
  40. },
  41. watch: {
  42. files: ['<config:resources.stylesheets>'],
  43. tasks: 'stylus'
  44. }
  45. });
  46. grunt.loadNpmTasks('grunt-contrib-stylus');
  47. // Default task.
  48. grunt.registerTask('default', 'stylus');
  49. };