blob: 940d8e73be3ca0718cf45eb5dbdc806b6176d3a5 [file] [log] [blame]
Nils Diewaldea236742015-03-26 21:55:36 +00001/**
2 */
3/*
4 * http://gruntjs.com/getting-started
5 *
Nils Diewalda297f062015-04-02 00:23:46 +00006 * Todo: Move all source files outside the public folder!
7
Nils Diewaldea236742015-03-26 21:55:36 +00008 * TODO: Use https://www.npmjs.com/package/grunt-contrib-compress
9 * for assets.
10 * http://yui.github.io/yuidoc/
11 * use it with https://www.npmjs.com/package/grunt-contrib-yuidoc
12 *
13 * RequireJS
14 * http://addyosmani.com/writing-modular-js/
15 * http://qnundrum.com/question/393866
Nils Diewalda297f062015-04-02 00:23:46 +000016 *
Nils Diewaldea236742015-03-26 21:55:36 +000017 */
18
19module.exports = function(grunt) {
20 grunt.initConfig({
21 pkg: grunt.file.readJSON('package.json'),
22 concat: {
23 dist: {
24 src : [
25 'js/lib/dagre/dagre.min.js',
26 'js/src/menu.js',
Nils Diewalda297f062015-04-02 00:23:46 +000027 'js/src/match.js',
Nils Diewaldea236742015-03-26 21:55:36 +000028 'js/src/hint.js',
Nils Diewald58141332015-04-07 16:18:45 +000029 'js/src/vc.js',
30 'js/src/api.js',
31 'js/src/session.js',
32 'js/src/tutorial.js',
33 'js/src/util.js'
Nils Diewaldea236742015-03-26 21:55:36 +000034 ],
35 dest: 'js/build/kalamar.js'
36 }
37 },
38 uglify : {
39 build : {
40 src: 'js/build/kalamar.js',
41 dest: 'js/build/kalamar.min.js'
42 }
43 },
44 imagemin: {
45 dynamic: {
46 files: [{
47 expand: true,
48 cwd: 'img/',
Nils Diewalda297f062015-04-02 00:23:46 +000049 src: ['*.{png,gif,jpg,svg}'],
Nils Diewaldea236742015-03-26 21:55:36 +000050 dest: 'img/build/'
51 }]
52 }
53 },
54 sass: {
55 dist: {
56 options: {
57 style: 'compressed'
58 },
59 files: {
60 'css/build/kalamar.css': 'scss/kalamar.scss'
61 }
62 }
63 },
Nils Diewalda297f062015-04-02 00:23:46 +000064 jasmine: {
65 pivotal: {
66 src: [
67 'js/src/menu.js',
68 'js/src/match.js',
69 'js/src/match.js',
70 'js/src/vc.js'
71 ],
72 options: {
73 specs: 'js/spec/*Spec.js'
74 }
75 }
76 },
Nils Diewaldea236742015-03-26 21:55:36 +000077 watch: {
78/*
79 options: {
80 livereload: true
81 },
82 scripts: {
83 files: ['js/*.js'],
84 tasks: ['concat', 'uglify'],
85 options: {
86 spawn: false
87 },
88 },
89*/
90 css: {
Nils Diewald58141332015-04-07 16:18:45 +000091 files: ['scss/{util,fonts,base,header,searchbar,matchinfo,resultinfo,kwic,menu,hint,pagination,logos,alertify,vc,media,kalamar,tutorial,query,sidebar}.scss'],
Nils Diewaldea236742015-03-26 21:55:36 +000092 tasks: ['sass'],
93 options: {
94 spawn: false
95 }
96 }
97 }
98 });
99
100 grunt.loadNpmTasks('grunt-contrib-concat');
101 grunt.loadNpmTasks('grunt-contrib-uglify');
102 grunt.loadNpmTasks('grunt-contrib-imagemin');
103 grunt.loadNpmTasks('grunt-contrib-watch');
104 grunt.loadNpmTasks('grunt-contrib-sass');
Nils Diewalda297f062015-04-02 00:23:46 +0000105 grunt.loadNpmTasks('grunt-contrib-jasmine');
Nils Diewaldea236742015-03-26 21:55:36 +0000106 grunt.registerTask('css', ['sass']);
107 grunt.registerTask('default', ['concat', 'uglify', 'imagemin', 'sass']);
108};