Skip to content
Snippets Groups Projects
Select Git revision
  • 141e98f027b67b3f5f9ba61d3cc08a4de729ec93
  • develop default protected
2 results

build.js

Blame
  • user avatar
    Nils Schneider authored
    141e98f0
    History
    build.js 1.73 KiB
    module.exports = function(grunt) {
      grunt.config.merge({
        copy: {
          html: {
            src: ["*.html"],
            expand: true,
            cwd: "html/",
            dest: "build/"
          },
          img: {
            src: ["img/*"],
            expand: true,
            dest: "build/"
          },
          vendorjs: {
            src: [ "es6-shim/es6-shim.min.js" ],
            expand: true,
            cwd: "bower_components/",
            dest: "build/vendor/"
          },
          roboto: {
            src: [ "fonts/*",
                   "roboto-slab-fontface.css"
                 ],
            expand: true,
            dest: "build/",
            cwd: "bower_components/roboto-slab-fontface"
          },
          ionicons: {
            src: [ "fonts/*",
                   "css/ionicons.min.css"
                 ],
            expand: true,
            dest: "build/",
            cwd: "bower_components/ionicons/"
          }
        },
        sass: {
          dist: {
            options: {
              style: "compressed"
            },
            files: {
              "build/style.css": "scss/main.scss"
            }
          }
        },
        cssmin: {
          target: {
            files: {
              "build/style.css": [ "bower_components/leaflet/dist/leaflet.css",
                                   "bower_components/Leaflet.label/dist/leaflet.label.css",
                                   "style.css"
                                 ]
            }
          }
        },
        requirejs: {
          compile: {
            options: {
              baseUrl: "lib",
              name: "../bower_components/almond/almond",
              mainConfigFile: "app.js",
              include: "../app",
              wrap: true,
              optimize: "uglify",
              out: "build/app.js"
            }
          }
        }
      })
    
      grunt.loadNpmTasks("grunt-contrib-copy")
      grunt.loadNpmTasks("grunt-contrib-requirejs")
      grunt.loadNpmTasks("grunt-contrib-sass")
    }