build.js 1.7 KB

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