1 module.exports = function(grunt) {
2 var sass = require('sass');
4 var preprocessors = {};
5 if (!process.env.SKIP_COVERAGE) {
6 preprocessors["<%= dirs.js %>/src/*.js"] = ["coverage"];
10 pkg: grunt.file.readJSON("package.json"),
12 build: "frontend/build",
15 static: "inboxen/static/compiled",
16 thirdparty: "node_modules",
19 build: ["<%= dirs.build %>", "<%= dirs.static %>"],
26 src: "<%= dirs.thirdparty %>/font-awesome/fonts/*",
27 dest: "<%= dirs.static %>/fonts/",
36 "<%= dirs.thirdparty %>/jquery/dist/jquery.js",
37 "<%= dirs.js %>/src/utils.js",
38 "<%= dirs.js %>/src/copy.js",
39 "<%= dirs.js %>/src/alert.js",
40 "<%= dirs.js %>/src/home.js",
41 "<%= dirs.js %>/src/search.js",
42 "<%= dirs.js %>/src/inbox.js",
44 dest: "<%= dirs.build %>/src/website.js",
49 "<%= dirs.thirdparty %>/patternomaly/dist/patternomaly.js",
50 "<%= dirs.thirdparty %>/chart.js/dist/Chart.js",
51 "<%= dirs.js %>/src/stats.js",
53 dest: "<%= dirs.build %>/src/stats.js",
69 src: ["<%= dirs.build %>/src/website.js"],
70 dest: "<%= dirs.static %>/website.min.js"
73 src: ["<%= dirs.build %>/src/stats.js"],
74 dest: "<%= dirs.static %>/stats.min.js"
80 outputStyle: "compressed",
81 includePaths: ["<%= dirs.thirdparty %>"],
83 sourceMapContents: true,
87 src: ["<%= dirs.css %>/inboxen.scss"],
88 dest: "<%= dirs.static %>/website.css"
96 stopSpecOnExpectationFailure: false
99 configFile: "karma.conf.js",
100 preprocessors: preprocessors,
103 pattern: "<%= dirs.js %>/data/*.html",
107 pattern: "<%= dirs.js %>/data/*.json",
111 "<%= dirs.thirdparty %>/jquery/dist/jquery.js",
112 "<%= dirs.thirdparty %>/chart.js/dist/Chart.js",
113 "<%= dirs.js %>/src/*.js",
114 "<%= dirs.js %>/tests/*.js"
119 browsers: ["ChromiumMaybeHeadless"]
123 browsers: ["Firefox"]
127 browsers: ["ChromiumMaybeHeadless"]
131 browsers: ["Firefox"]
139 options: {jshintrc: true},
140 all: ["<%= dirs.js %>"]
144 grunt.loadNpmTasks('grunt-contrib-clean');
145 grunt.loadNpmTasks('grunt-contrib-copy');
146 grunt.loadNpmTasks("grunt-contrib-concat");
147 grunt.loadNpmTasks("grunt-contrib-uglify");
148 grunt.loadNpmTasks('grunt-sass');
149 grunt.loadNpmTasks('grunt-karma');
150 grunt.loadNpmTasks('grunt-contrib-jshint');
152 grunt.registerTask("default", ["clean", "copy", "concat", "uglify", "sass"]);
153 grunt.registerTask("tests", ["karma:firefox", "karma:chrome"]);