-
Notifications
You must be signed in to change notification settings - Fork 0
/
GruntFile.js
112 lines (94 loc) · 2.36 KB
/
GruntFile.js
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*!
* polling-station GruntFile
* https://github.com/perks/polling-station
* @author Chris Evans
*/
'use strict';
var LIVERELOAD_PORT = 35279;
/*
* Grunt Module
*/
module.exports = function(grunt) {
/*
*Config
*/
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
tag: {
banner: '/*!\n' + ' * <%= pkg.name %>\n' + ' * <%= pkg.title %>\n' + ' * <%= pkg.url %>\n' + ' * @author <%= pkg.author %>\n' + ' * @version <%= pkg.version %>\n' + ' * Copyright <%= pkg.copyright %>. <%= pkg.license %> licensed.\n' + ' */\n'
},
compass: {
dist: {
options: {
sassDir: './assets/scss',
cssDir: './assets/css',
// outputStyle: 'compressed',
}
}
},
watch: {
options: {
livereload: LIVERELOAD_PORT
},
css: {
files: './assets/scss/*.scss',
tasks: ['compass']
},
js: {
files: 'src/*.js',
tasks: ['uglify']
}
},
connect: {
server: {
options: {
livereload: LIVERELOAD_PORT,
port: 8080
}
}
},
open: {
server: {
path: 'http://localhost:<%= connect.options.port %>'
}
},
uglify: {
files: {
src: 'src/*.js',
dest: 'dist/',
expand: true,
flatten: true,
ext: '.min.js'
},
options: {
banner: '<%= tag.banner %>'
}
},
mocha: {
all: {
src: ['tests/testrunner.html'],
},
options: {
run: true,
reporter: 'Nyan'
}
}
});
/**
* Load Grunt plugins
*/
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('default', [
'watch'
]);
grunt.registerTask('build', [
'uglify'
]);
grunt.registerTask('server', function(target) {
grunt.task.run([
'uglify',
'connect',
'watch'
]);
});
};