build.js 2.2 KB

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