GruntFile.coffee 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. module.exports = (grunt) ->
  2. grunt.initConfig
  3. pkg: grunt.file.readJSON "packages/lungo/component.json"
  4. meta:
  5. file: 'lungo'
  6. packages: "packages",
  7. # BETA
  8. endpoint: "example/components",
  9. version: ".brownie",
  10. # RELEASE
  11. # endpoint: "packages",
  12. # version: "",
  13. banner: '/* <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy/m/d") %>\n' +
  14. ' <%= pkg.homepage %>\n' +
  15. ' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
  16. ' - Licensed <%= _.pluck(pkg.license, "type").join(", ") %> */\n'
  17. source:
  18. coffee: [
  19. 'src/Lungo.coffee',
  20. 'src/modules/Lungo.Attributes.coffee',
  21. 'src/modules/Lungo.Cache.coffee',
  22. 'src/modules/Lungo.Constants.coffee',
  23. 'src/modules/Lungo.Core.coffee',
  24. 'src/modules/Lungo.Dom.coffee',
  25. 'src/modules/Lungo.Events.coffee',
  26. 'src/modules/Lungo.Fallback.coffee',
  27. 'src/modules/Lungo.Init.coffee',
  28. 'src/modules/Lungo.Notification.coffee',
  29. 'src/modules/Lungo.Resource.coffee',
  30. 'src/modules/Lungo.Scroll.coffee',
  31. 'src/modules/Lungo.Service.coffee',
  32. 'src/modules/Lungo.Router.coffee',
  33. 'src/modules/Lungo.Aside.coffee',
  34. 'src/modules/Lungo.Section.coffee',
  35. 'src/modules/Lungo.Article.coffee',
  36. 'src/boot/*.coffee',
  37. 'src/element/*.coffee']
  38. javascripts: [
  39. 'build/*.js']
  40. stylus: [
  41. 'src/stylesheets/lungo.base.styl',
  42. 'src/stylesheets/lungo.layout.styl',
  43. 'src/stylesheets/lungo.layout.*.styl',
  44. 'src/stylesheets/lungo.widget.styl',
  45. 'src/stylesheets/lungo.widget.*.styl',
  46. 'src/stylesheets/lungo.media.*.styl']
  47. theme: [
  48. 'src/stylesheets/theme/*.styl']
  49. icons: [
  50. 'src/stylesheets/lungo.icon**.styl']
  51. coffee:
  52. core: files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.debug.js': '<%= source.coffee %>'
  53. uglify:
  54. options: compress: false, banner: "<%= meta.banner %>"
  55. engine: files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.js': '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.debug.js'
  56. stylus:
  57. core:
  58. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.css': '<%=source.stylus%>'
  59. theme:
  60. options: compress: true
  61. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.theme.css': '<%=source.theme%>'
  62. icons:
  63. files: '<%=meta.packages%>/<%=meta.file%>.icon/<%=meta.file%>.icon.css': '<%=source.icons%>'
  64. copy:
  65. theme:
  66. expand: true, flatten: true, src: '<%=source.theme%>', dest: '<%=meta.packages%>/<%=meta.file%>.theme/'
  67. watch:
  68. coffee:
  69. files: ['<%= source.coffee %>']
  70. tasks: ["coffee:core"]
  71. stylus:
  72. files: ['<%= source.stylus %>', '<%= source.theme %>']
  73. tasks: ["stylus:core", "stylus:theme"]
  74. grunt.loadNpmTasks "grunt-contrib-coffee"
  75. grunt.loadNpmTasks "grunt-contrib-concat"
  76. grunt.loadNpmTasks "grunt-contrib-uglify"
  77. grunt.loadNpmTasks "grunt-contrib-stylus"
  78. grunt.loadNpmTasks "grunt-contrib-copy"
  79. grunt.loadNpmTasks "grunt-contrib-watch"
  80. grunt.registerTask "default", ["coffee", "uglify", "stylus", "copy"]