meshviewer/tasks/build.js

133 lines
2.8 KiB
JavaScript
Raw Normal View History

module.exports = function (grunt) {
2016-05-27 21:59:01 +00:00
"use strict";
2015-03-29 12:43:02 +00:00
grunt.config.merge({
bowerdir: "bower_components",
2015-03-29 12:43:02 +00:00
copy: {
html: {
src: ["*.html"],
expand: true,
cwd: "html/",
dest: "build/"
},
2015-03-31 15:22:36 +00:00
img: {
src: ["img/*"],
expand: true,
dest: "build/"
},
2015-03-29 12:43:02 +00:00
vendorjs: {
2016-05-22 14:22:24 +00:00
src: ["es6-shim/es6-shim.min.js",
"es6-shim/es6-shim.map"],
2015-03-29 12:43:02 +00:00
expand: true,
cwd: "bower_components/",
dest: "build/vendor/"
},
2015-04-04 16:01:57 +00:00
robotoSlab: {
src: ["fonts/*",
"roboto-slab-fontface.css"
],
2015-03-29 12:43:02 +00:00
expand: true,
dest: "build/",
cwd: "bower_components/roboto-slab-fontface"
},
2015-04-04 16:01:57 +00:00
roboto: {
src: ["fonts/*",
"roboto-fontface.css"
],
2015-04-04 16:01:57 +00:00
expand: true,
dest: "build/",
cwd: "bower_components/roboto-fontface"
},
2015-03-29 12:43:02 +00:00
ionicons: {
src: ["fonts/*"],
2015-03-29 12:43:02 +00:00
expand: true,
dest: "build/",
cwd: "assets/icons/"
2015-04-15 20:25:22 +00:00
},
leafletImages: {
src: ["images/*"],
2015-04-15 20:25:22 +00:00
expand: true,
dest: "build/",
cwd: "bower_components/leaflet/dist/"
2015-03-29 12:43:02 +00:00
}
},
2015-03-31 13:38:21 +00:00
sass: {
options: {
sourceMap: true,
outputStyle: "compressed"
},
2015-03-31 13:38:21 +00: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"
}
},
inline: {
dist: {
options: {
cssmin: true,
uglify: true
},
src: "build/index.html",
dest: "build/index.html"
}
},
"bower-install-simple": {
options: {
directory: "<%=bowerdir%>",
color: true,
interactive: false,
production: true
},
"prod": {
options: {
production: true
}
}
},
2015-03-29 12:43:02 +00:00
requirejs: {
default: {
2015-03-29 12:43:02 +00:00
options: {
baseUrl: "lib",
name: "../bower_components/almond/almond",
mainConfigFile: "app.js",
include: "../app",
out: "build/app.js",
2016-05-23 07:30:19 +00:00
build: true
}
},
dev: {
options: {
baseUrl: "lib",
name: "../bower_components/almond/almond",
mainConfigFile: "app.js",
include: "../app",
optimize: "none",
out: "build/app.js",
build: false
2015-03-29 12:43:02 +00:00
}
}
}
});
2015-03-29 12:43:02 +00:00
grunt.loadNpmTasks("grunt-bower-install-simple");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-requirejs");
grunt.loadNpmTasks("grunt-sass");
grunt.loadNpmTasks("grunt-postcss");
grunt.loadNpmTasks("grunt-inline");
};