-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
57 lines (52 loc) · 1.17 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
'use strict';
var matchdep = require('matchdep');
module.exports = function(grunt) {
grunt.initConfig({
clean: {
dist: ['dist/*.js']
},
browserify: {
options: {
browserifyOptions: {
debug: false,
standalone: 'c' // Export to window.c
},
ignore: ['buffer'], // will use ArrayBuffer in browsers
transform: ['babelify']
},
dist: {
src: ['index.js'],
dest: 'dist/c.js'
}
},
uglify: {
dist: {
files: {
'dist/c.min.js': 'dist/c.js',
}
}
},
simplemocha: {
options: {
globals: ['expect'],
ui: 'bdd',
reporter: 'tap'
},
test: {
src: 'test/spec/*.js'
}
},
eslint: {
target: {
src: ['lib/**/*.js']
}
},
});
// Load all grunt tasks in package.json
matchdep.filterAll('grunt-*').forEach(function(pkgName){
grunt.loadNpmTasks(pkgName);
});
grunt.registerTask('test', ['browserify', 'simplemocha']);
grunt.registerTask('release', ['clean:dist', 'browserify', 'uglify']);
grunt.registerTask('default', ['eslint', 'test', 'release']);
};