forked from nytimes/backbone.stickit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grunt.js
94 lines (77 loc) · 2.01 KB
/
grunt.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib');
grunt.loadNpmTasks('grunt-docco');
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '//\n' +
'// <%= pkg.name %> - v<%= pkg.version %>\n' +
'// The MIT License\n' +
'// Copyright (c) 2012 The New York Times, CMS Group, Matthew DeLambo <delambo@gmail.com> \n' +
'//'
},
lint: {
all: ['backbone.stickit.js']
},
jshint: {
options: {
browser: true,
indent: 1,
white: false,
evil: true,
regexdash: true,
wsh: true,
trailing: true,
eqnull: true,
expr: true,
boss: true,
node: true,
strict: false
}
},
qunit: {
all: ['http://localhost:8000/test/index.html']
},
server: {
port: 8000,
base: '.'
},
concat: {
dist: {
src: ['<banner>', '<file_strip_banner:backbone.stickit.js>'],
dest: 'dist/backbone.stickit.js'
}
},
min: {
dist: {
src: ['<banner>', 'dist/backbone.stickit.js'],
dest: 'dist/backbone.stickit.min.js'
}
},
docco: {
app: {
src: ['dist/backbone.stickit.js']
}
},
compress: {
zip: {
files: {
"dist/backbone.stickit.gz": "dist/backbone.stickit.min.js",
"dist/backbone.stickit_<%= pkg.version %>.zip": ["dist/**"]
}
}
},
clean: {
build: ['dist'],
docco: ['docs']
}
});
// qunit/phantomjs is mostly broken until the next release.
// https://github.com/gruntjs/grunt/issues/219
grunt.registerTask('test', 'server qunit');
grunt.registerTask('build', 'lint clean:build concat min docco cp-docs clean:docco compress');
grunt.registerTask('cp-docs', function() {
grunt.file.copy('docs/docco.css', 'dist/docs/annotated/docco.css');
grunt.file.copy('docs/backbone.stickit.html', 'dist/docs/annotated/index.html');
});
};