build.js 2.1 KB

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