/
Gruntfile.js
49 lines (42 loc) · 1 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
/* global require, module */
var matchdep = require('matchdep');
module.exports = function(grunt){
matchdep.filterDev('grunt-*').forEach(grunt.loadNpmTasks);
matchdep.filterDev('gruntify-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
clean: {
tmp: [ 'tmp/**/*' ]
},
babel: {
options: {
presets: ['latest']
},
testLib: {
expand: true,
cwd: 'lib',
src: [ '**/*.js' ],
dest: 'tmp/lib'
},
tests: {
expand: true,
cwd: 'test',
src: [ '**/*.js' ],
dest: 'tmp/test'
}
},
eslint: {
all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js']
},
copy: {
main: {
cwd: 'tmp/lib/',
src: '**',
dest: 'dist/lib/',
expand: true
}
}
});
grunt.registerTask('test', [ 'clean', 'babel:testLib', 'babel:tests' ]);
grunt.registerTask('default', [ 'babel:testLib', 'babel:tests' ]);
grunt.registerTask('dist', [ 'test', 'copy' ]);
};