hopglass/tasks/build.js

108 lines
2.5 KiB
JavaScript
Raw Permalink Normal View History

2015-03-29 14:43:02 +02:00
module.exports = function(grunt) {
grunt.config.merge({
2019-01-20 18:15:14 +01:00
nodedir: "node_modules",
2015-03-29 14:43:02 +02:00
copy: {
html: {
options: {
process: function (content) {
return content.replace("#revision#", grunt.option("gitRevision"))
}
},
2015-03-29 14:43:02 +02:00
src: ["*.html"],
expand: true,
cwd: "html/",
dest: "build/"
},
2015-03-31 17:22:36 +02:00
img: {
src: ["img/*"],
expand: true,
dest: "build/"
},
2015-03-29 14:43:02 +02:00
vendorjs: {
2016-09-03 01:31:26 +02:00
src: ["es6-shim/es6-shim.min.js",
"es6-shim/es6-shim.map"],
2015-03-29 14:43:02 +02:00
expand: true,
2019-01-20 18:15:14 +01:00
cwd: "node_modules/",
2015-03-29 14:43:02 +02:00
dest: "build/vendor/"
},
2015-04-04 18:01:57 +02:00
roboto: {
2019-01-26 04:11:47 +01:00
src: [ "fonts/roboto/*",
"fonts/roboto-slab/*",
"css/roboto/roboto-fontface.css",
"css/roboto-slab/roboto-slab-fontface.css"
2015-04-04 18:01:57 +02:00
],
expand: true,
dest: "build/",
2019-01-26 04:11:47 +01:00
cwd: "node_modules/roboto-fontface/"
2015-04-04 18:01:57 +02:00
},
2015-03-29 14:43:02 +02:00
ionicons: {
src: [ "fonts/*",
"css/ionicons.min.css"
],
expand: true,
dest: "build/",
2019-01-20 18:15:14 +01:00
cwd: "node_modules/ionicons/"
2015-04-15 22:25:22 +02:00
},
leafletImages: {
src: [ "images/*" ],
expand: true,
dest: "build/",
2019-01-20 18:15:14 +01:00
cwd: "node_modules/leaflet/dist/"
2015-03-29 14:43:02 +02:00
}
},
2015-03-31 15:38:21 +02:00
sass: {
options: {
sourceMap: true,
2019-01-20 15:07:35 +01:00
outputStyle: "compressed",
implementation: require("dart-sass")
},
2015-03-31 15:38:21 +02:00
dist: {
files: {
"build/style.css": "scss/main.scss"
}
}
},
postcss: {
options: {
map: true,
processors: [
require("autoprefixer")({
browsers: ["last 2 versions"]
})
]
},
dist: {
src: "build/style.css"
}
},
2015-03-29 14:43:02 +02:00
cssmin: {
target: {
files: {
2019-01-20 18:15:14 +01:00
"build/style.css": [ "node_modules/leaflet/dist/leaflet.css",
"node_modules/leaflet-label/dist/leaflet.label.css",
2015-03-29 14:43:02 +02:00
"style.css"
]
}
}
},
requirejs: {
compile: {
options: {
baseUrl: "lib",
2019-01-20 18:15:14 +01:00
name: "../node_modules/almond/almond",
2015-03-29 14:43:02 +02:00
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-sass")
grunt.loadNpmTasks("grunt-postcss")
2015-03-29 14:43:02 +02:00
}