GruntFile.coffee 4.1 KB

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