build.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. module.exports = function(grunt) {
  2. grunt.config.merge({
  3. bowerdir: "bower_components",
  4. copy: {
  5. html: {
  6. options: {
  7. process: function (content) {
  8. return content.replace("#revision#", grunt.option("gitRevision"))
  9. }
  10. },
  11. src: ["*.html"],
  12. expand: true,
  13. cwd: "html/",
  14. dest: "build/"
  15. },
  16. img: {
  17. src: ["img/*"],
  18. expand: true,
  19. dest: "build/"
  20. },
  21. vendorjs: {
  22. src: [ "es6-shim/es6-shim.min.js" ],
  23. expand: true,
  24. cwd: "bower_components/",
  25. dest: "build/vendor/"
  26. },
  27. robotoSlab: {
  28. src: [ "fonts/*",
  29. "roboto-slab-fontface.css"
  30. ],
  31. expand: true,
  32. dest: "build/",
  33. cwd: "bower_components/roboto-slab-fontface"
  34. },
  35. roboto: {
  36. src: [ "fonts/*",
  37. "roboto-fontface.css"
  38. ],
  39. expand: true,
  40. dest: "build/",
  41. cwd: "bower_components/roboto-fontface"
  42. },
  43. ionicons: {
  44. src: [ "fonts/*",
  45. "css/ionicons.min.css"
  46. ],
  47. expand: true,
  48. dest: "build/",
  49. cwd: "bower_components/ionicons/"
  50. },
  51. leafletImages: {
  52. src: [ "images/*" ],
  53. expand: true,
  54. dest: "build/",
  55. cwd: "bower_components/leaflet/dist/"
  56. }
  57. },
  58. sass: {
  59. dist: {
  60. options: {
  61. style: "compressed"
  62. },
  63. files: {
  64. "build/style.css": "scss/main.scss"
  65. }
  66. }
  67. },
  68. cssmin: {
  69. target: {
  70. files: {
  71. "build/style.css": [ "bower_components/leaflet/dist/leaflet.css",
  72. "bower_components/Leaflet.label/dist/leaflet.label.css",
  73. "style.css"
  74. ]
  75. }
  76. }
  77. },
  78. "bower-install-simple": {
  79. options: {
  80. directory: "<%=bowerdir%>",
  81. color: true,
  82. interactive: false,
  83. production: true
  84. },
  85. "prod": {
  86. options: {
  87. production: true
  88. }
  89. }
  90. },
  91. requirejs: {
  92. compile: {
  93. options: {
  94. baseUrl: "lib",
  95. name: "../bower_components/almond/almond",
  96. mainConfigFile: "app.js",
  97. include: "../app",
  98. wrap: true,
  99. optimize: "uglify",
  100. out: "build/app.js"
  101. }
  102. }
  103. }
  104. })
  105. grunt.loadNpmTasks("grunt-bower-install-simple")
  106. grunt.loadNpmTasks("grunt-contrib-copy")
  107. grunt.loadNpmTasks("grunt-contrib-requirejs")
  108. grunt.loadNpmTasks("grunt-contrib-sass")
  109. }