blob: 4183d339292f1694bf438f46d3c392944d64ed99 [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',
29 'js/src/vc.js'
30 ],
31 dest: 'js/build/kalamar.js'
32 }
33 },
34 uglify : {
35 build : {
36 src: 'js/build/kalamar.js',
37 dest: 'js/build/kalamar.min.js'
38 }
39 },
40 imagemin: {
41 dynamic: {
42 files: [{
43 expand: true,
44 cwd: 'img/',
Nils Diewalda297f062015-04-02 00:23:46 +000045 src: ['*.{png,gif,jpg,svg}'],
Nils Diewaldea236742015-03-26 21:55:36 +000046 dest: 'img/build/'
47 }]
48 }
49 },
50 sass: {
51 dist: {
52 options: {
53 style: 'compressed'
54 },
55 files: {
56 'css/build/kalamar.css': 'scss/kalamar.scss'
57 }
58 }
59 },
Nils Diewalda297f062015-04-02 00:23:46 +000060 jasmine: {
61 pivotal: {
62 src: [
63 'js/src/menu.js',
64 'js/src/match.js',
65 'js/src/match.js',
66 'js/src/vc.js'
67 ],
68 options: {
69 specs: 'js/spec/*Spec.js'
70 }
71 }
72 },
Nils Diewaldea236742015-03-26 21:55:36 +000073 watch: {
74/*
75 options: {
76 livereload: true
77 },
78 scripts: {
79 files: ['js/*.js'],
80 tasks: ['concat', 'uglify'],
81 options: {
82 spawn: false
83 },
84 },
85*/
86 css: {
Nils Diewalda297f062015-04-02 00:23:46 +000087 files: ['scss/{util,fonts,base,header,searchbar,matchinfo,resultinfo,kwic,menu,pagination,logos,alertify,kalamar}.scss'],
Nils Diewaldea236742015-03-26 21:55:36 +000088 tasks: ['sass'],
89 options: {
90 spawn: false
91 }
92 }
93 }
94 });
95
96 grunt.loadNpmTasks('grunt-contrib-concat');
97 grunt.loadNpmTasks('grunt-contrib-uglify');
98 grunt.loadNpmTasks('grunt-contrib-imagemin');
99 grunt.loadNpmTasks('grunt-contrib-watch');
100 grunt.loadNpmTasks('grunt-contrib-sass');
Nils Diewalda297f062015-04-02 00:23:46 +0000101 grunt.loadNpmTasks('grunt-contrib-jasmine');
Nils Diewaldea236742015-03-26 21:55:36 +0000102 grunt.registerTask('css', ['sass']);
103 grunt.registerTask('default', ['concat', 'uglify', 'imagemin', 'sass']);
104};