-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
53 lines (50 loc) · 1.08 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
'use strict'
module.exports = function(grunt) {
grunt.initConfig({
eslint: {
options: {
configFile: 'eslintrc.json'
},
target: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js']
},
watch: {
js: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*'],
tasks: ['eslint', 'mochaTest']
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
clearRequireCache: true,
require: ['babel/register']
},
src: grunt.option('src') || ['test/**/*.test.js']
}
},
babel: {
options: {
sourceMap: true
},
dist: {
files: [{
expand: true,
cwd: 'src/',
src: '**/**.js',
dest: 'dist/'
}]
}
},
shell: {
gitAdd: {
command: 'git add . -A'
}
}
})
require('load-grunt-tasks')(grunt)
grunt.registerTask('test', ['mochaTest'])
grunt.registerTask('publish', function(type) {
grunt.task.run(['eslint', 'test', 'babel', 'shell:gitAdd', 'release:' + type])
})
}