build.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. "intl/Intl.complete.js"
  18. ],
  19. expand: true,
  20. cwd: "bower_components/",
  21. dest: "build/vendor/"
  22. },
  23. roboto: {
  24. src: [ "fonts/*",
  25. "roboto-slab-fontface.css"
  26. ],
  27. expand: true,
  28. dest: "build/",
  29. cwd: "bower_components/roboto-slab-fontface"
  30. },
  31. ionicons: {
  32. src: [ "fonts/*",
  33. "css/ionicons.min.css"
  34. ],
  35. expand: true,
  36. dest: "build/",
  37. cwd: "bower_components/ionicons/"
  38. }
  39. },
  40. sass: {
  41. dist: {
  42. options: {
  43. style: "compressed"
  44. },
  45. files: {
  46. "build/style.css": "scss/main.scss"
  47. }
  48. }
  49. },
  50. cssmin: {
  51. target: {
  52. files: {
  53. "build/style.css": [ "bower_components/leaflet/dist/leaflet.css",
  54. "bower_components/Leaflet.label/dist/leaflet.label.css",
  55. "style.css"
  56. ]
  57. }
  58. }
  59. },
  60. requirejs: {
  61. compile: {
  62. options: {
  63. baseUrl: "lib",
  64. name: "../bower_components/almond/almond",
  65. mainConfigFile: "app.js",
  66. include: "../app",
  67. wrap: true,
  68. optimize: "uglify",
  69. out: "build/app.js"
  70. }
  71. }
  72. }
  73. })
  74. grunt.loadNpmTasks("grunt-contrib-copy")
  75. grunt.loadNpmTasks("grunt-contrib-requirejs")
  76. grunt.loadNpmTasks("grunt-contrib-sass")
  77. }