-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathGruntfile.js
73 lines (73 loc) · 1.86 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
70
71
72
73
'use strict';
exports = module.exports = function (grunt) {
grunt.initConfig({
clean: {
doc: ['.tmp', '.grunt']
},
uglify: {
options: {
compress: {}
},
build: {
files: {
'dist/backbone-react-component-min.js': ['lib/component.js']
}
}
},
copy: {
build: {
files: [
{src: ['lib/component.js'], dest: 'dist/backbone-react-component.js'}
]
},
doc: {
files: [
{cwd: 'docs', src: ['**', '!component.html'], dest: '.tmp', expand: true},
{src: ['docs/component.html'], dest: '.tmp/index.html'}
]
}
},
docco: {
doc: {
src: ['lib/component.js'],
options: {
layout: 'parallel'
}
}
},
'gh-pages': {
doc: {
options: {
base: '.tmp'
},
src: ['**']
}
},
jasmine: {
dev: {
src: ['lib/**/*.js'],
options: {
specs: 'test/specs/**/*.js',
vendor: [
'test/helpers/polyfills.js',
'node_modules/underscore/underscore.js',
'node_modules/backbone/backbone.js',
'node_modules/react/dist/react.js',
'node_modules/react-dom/dist/react-dom.js'
]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-docco');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.registerTask('default', ['build']);
grunt.registerTask('build', ['copy:build', 'uglify:build']);
grunt.registerTask('doc', ['clean:doc', 'docco:doc']);
grunt.registerTask('publish-doc', ['doc', 'copy:doc', 'gh-pages:doc', 'clean:doc']);
grunt.registerTask('test', ['jasmine:dev']);
};