-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
69 lines (64 loc) · 1.8 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
var sourceFiles = ['Gruntfile.js', 'lib/*.js', 'lib/**/*.js'];
module.exports = function(grunt) {
/**
* initialize configuration
*/
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
run: ['dist/**/*']
},
watch: {
scripts: {
files: ['lib/**/*.js', 'test/*.spec.js'],
tasks: ['build']
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
source: sourceFiles
},
uglify: {
dist: {
files: {
'dist/confity.min.js': ['dist/confity.js'],
'dist/confity.nopromises.min.js': ['dist/confity.nopromises.js']
}
}
},
concat: {
options: {
separator: '',
},
confity: {
files: {
'dist/confity.js': [
'bower_components/es6-promise/promise.js',
'lib/confity.js'
],
'dist/confity.nopromises.js': [
'lib/confity.js'
]
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/*.spec.js']
}
}
});
require('load-grunt-tasks')(grunt);
/**
* register tasks.
*/
grunt.registerTask('test', ['mochaTest']);
grunt.registerTask('build', ['jshint', 'test']);
grunt.registerTask('release', ['clean', 'build', 'concat', 'uglify']);
grunt.registerTask('default', ['build', 'watch']);
};