This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
/
Gruntfile.js
59 lines (57 loc) · 1.46 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
expr: true
},
all: ['Gruntfile.js', 'index.js', 'lib/**/*.js', 'test/*.js']
},
concat: {
options: {
banner: grunt.file.read('browser/banner.jst'),
footer: grunt.file.read('browser/footer.jst'),
process: function(src) {
var noModules = src.replace('= module.exports =', '=');
return noModules.replace(/var .+? = require\(.+?\);/g, '');
}
},
dist: {
src: [
'lib/state.js',
'lib/promise.js',
'lib/errors/validation.js',
'lib/errors/timeout.js',
'lib/future.js',
'lib/collections.js'
],
dest: 'browser/concurrent.js'
}
},
uglify: {
dist: {
files: {
'browser/concurrent.min.js': ['browser/concurrent.js']
}
}
},
shell: {
docs: {
command: 'docker -i lib -o doc'
}
},
'gh-pages': {
options: {
base: 'doc'
},
src: ['**']
}
});
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
grunt.registerTask('docs', ['shell', 'gh-pages']);
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-gh-pages');
};