GruntFile.coffee 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. uglify:
  56. options:
  57. compress: false
  58. # beautify: true
  59. banner: '<%= meta.banner %>'
  60. endpoint:
  61. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.js': '<%=resources.javascripts %>'
  62. stylus:
  63. stylesheets:
  64. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.css': '<%=resources.stylesheets%>'
  65. theme:
  66. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.theme.css': '<%=resources.theme%>'
  67. icons:
  68. options: compress: false
  69. files: '<%=meta.endpoint%>/<%=meta.file%>.icon/<%=meta.file%>.icon.css': '<%=resources.icons%>'
  70. copy:
  71. theme:
  72. expand: true, flatten: true, src: '<%=resources.theme%>', dest: '<%=meta.endpoint%>/<%=meta.file%>.theme/'
  73. watch:
  74. files: ['<%= resources.core %>', '<%= resources.modules %>', '<%= resources.stylesheets %>', '<%= resources.theme %>']
  75. # tasks: ["coffee", "uglify", "stylus:stylesheets", "stylus:theme"]
  76. tasks: ["coffee", "uglify"]
  77. # tasks: ["stylus:stylesheets", "stylus:theme"]
  78. grunt.loadNpmTasks "grunt-contrib-coffee"
  79. grunt.loadNpmTasks "grunt-contrib-uglify"
  80. grunt.loadNpmTasks "grunt-contrib-stylus"
  81. grunt.loadNpmTasks "grunt-contrib-copy"
  82. grunt.loadNpmTasks "grunt-contrib-watch"
  83. grunt.registerTask "default", ["coffee", "uglify", "stylus", "copy"]