-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGruntfile.js
More file actions
76 lines (65 loc) · 2.11 KB
/
Gruntfile.js
File metadata and controls
76 lines (65 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*global module:false, require:false*/
module.exports = function (grunt) {
'use strict';
var path = require('path'),
lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet,
folderMount = function folderMount (connect, point) {
return connect.static(path.resolve(point));
};
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
watch : {
tests : {
options : {
// Start a live reload server on the default port: 35729
livereload : true
},
files : [
'tests/**/*.js',
'app/*.js'
]
}
},
connect : {
tests : {
options : {
port : 9001,
hostname : 'localhost',
base : './',
middleware : function (connect, options) {
return [lrSnippet, folderMount(connect, options.base)];
}
}
}
},
open : {
tests : {
path : 'http://localhost:9001/tests/'
}
},
clean : {
build : ['build']
},
copy : {
build : {
files : [
{expand: true, src : 'app/**', dest : 'build'},
{expand: true, src : 'tests/**', dest : 'build'}
]
}
},
build_gh_pages : {
build : {
options : {
build_branch : 'gh-pages',
dist : 'build'
}
}
}
});
// To start editing your slideshow using livereload, run 'grunt server'
grunt.registerTask('testServer', 'Build and watch task', ['connect:tests', 'open:tests', 'watch']);
grunt.registerTask('deploy', 'Deploy website to gh-pages', ['clean:build', 'copy:build', 'build_gh_pages:build']);
};