-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
51 lines (49 loc) · 1.47 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
var srcFiles = ['src/js/*.js'],
srcHtml = ['src/*.html'],
srcCss = ['src/css/*.css'],
srcTemplates = ['src/templates/*.hbs'],
specJs = ['spec/*.js'],
specHtml = ['spec/*Spec.html'],
lintFiles = [].concat(srcFiles, specJs, ['Gruntfile.js']),
watchFiles = [].concat(srcFiles, srcTemplates, srcHtml, srcCss, specJs, specHtml, lintFiles);
/* global module, process */
module.exports = function(grunt) {
/* jshint camelcase: false */
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: true
},
all: lintFiles
},
connect: {
server: {
options: {
port: 1337
}
}
},
watch: {
scripts: {
options: {
atBegin: true
},
files: watchFiles,
tasks: ['default']
}
},
mocha_phantomjs: {
all: specHtml
},
clean: [ 'dist/', 'build/' ]
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-mocha-phantomjs');
grunt.registerTask('default', ['jshint', 'mocha_phantomjs']);
grunt.registerTask('dev', ['connect', 'watch']);
};