-
Notifications
You must be signed in to change notification settings - Fork 13
/
Gruntfile.js
98 lines (92 loc) · 1.89 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
coffee: {
compileSources: {
expand: true,
flatten: true,
src: ['src/*.coffee'],
dest: 'tmp/src/',
ext: '.js'
},
compileSpecs: {
expand: true,
flatten: true,
src: ['spec/*.coffee', 'qunitspec/*.coffee'],
dest: 'tmp/spec/javascripts/',
ext: '.js'
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: [
'tmp/src/ember-couchdb-kit.js',
'tmp/src/document-adapter.js',
'tmp/src/attachment-adapter.js',
'tmp/src/revs-adapter.js',
'tmp/src/registry.js',
'tmp/src/changes-feed.js'
],
dest: 'dist/ember-couchdb-kit.js'
}
},
uglify: {
minify_distribution: {
files: {
'dist/ember-couchdb-kit.min.js': ['dist/ember-couchdb-kit.js']
}
}
},
mkdir: {
all: {
options: {
create: ['tmp', 'tmp/src', 'tmp/spec']
}
}
},
qunit: {
local: {
options: {
urls: ['http://localhost:9997/spec/index.html']
}
}
},
connect: {
server: {
options: {
base: '.',
port: 9997,
keepalive: true
}
}
},
watch: {
tests: {
files: ['src/*.coffee', 'spec/*.coffee', 'spec/index.html'],
tasks: ['test']
}
},
clean: ['dist/*.js', 'tmp/src/*.js', 'tmp/spec/*.js']
});
grunt.registerTask('build', [
'clean',
'mkdir',
'coffee:compileSources',
'coffee:compileSpecs',
'concat:dist',
'uglify:minify_distribution'
]);
grunt.registerTask('test', [
'build',
'connect',
'qunit'
]);
grunt.registerTask('dev', [
'test',
'watch'
]);
};