build.js 1.7 KB

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