GruntFile.coffee 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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/boot/*.coffee',
  35. 'src/element/*.coffee']
  36. javascripts: [
  37. 'build/*.js']
  38. stylesheets: [
  39. 'src/stylesheets/lungo.base.styl',
  40. 'src/stylesheets/lungo.layout.styl',
  41. 'src/stylesheets/lungo.layout.*.styl',
  42. 'src/stylesheets/lungo.widget.styl',
  43. 'src/stylesheets/lungo.widget.*.styl',
  44. 'src/stylesheets/lungo.media.*.styl']
  45. theme: [
  46. 'src/stylesheets/theme/*.styl']
  47. icons: [
  48. 'src/stylesheets/lungo.icon**.styl']
  49. coffee:
  50. compile:
  51. files:
  52. 'build/<%= meta.file %>.core.js': ['<%= resources.core %>']
  53. 'build/<%= meta.file %>.modules.js': ['<%= resources.modules %>']
  54. uglify:
  55. options:
  56. compress: false
  57. # beautify: true
  58. banner: '<%= meta.banner %>'
  59. endpoint:
  60. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.js': '<%=resources.javascripts %>'
  61. stylus:
  62. stylesheets:
  63. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.css': '<%=resources.stylesheets%>'
  64. theme:
  65. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.theme.css': '<%=resources.theme%>'
  66. icons:
  67. options: compress: false
  68. files: '<%=meta.endpoint%>/<%=meta.file%>.icon/<%=meta.file%>.icon.css': '<%=resources.icons%>'
  69. copy:
  70. theme:
  71. expand: true, flatten: true, src: '<%=resources.theme%>', dest: '<%=meta.endpoint%>/<%=meta.file%>.theme/'
  72. watch:
  73. files: ['<%= resources.core %>', '<%= resources.modules %>', '<%= resources.stylesheets %>', '<%= resources.theme %>']
  74. tasks: ["coffee", "uglify", "stylus:stylesheets", "stylus:theme"]
  75. grunt.loadNpmTasks "grunt-contrib-coffee"
  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"]