GruntFile.coffee 3.6 KB

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