-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
88 lines (84 loc) · 2.06 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
var pkg = require('./package.json');
module.exports = function(grunt) {
"use strict";
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bumpup: {
options: {
updateProps: {
pkg: 'package.json'
}
},
file: 'package.json'
},
watch: {
local: {
options: {
debounceDelay: 5000,
interrupt: true
},
files: ['*.js','src/**/*.js', 'test/**/*.js'],
tasks: ['default']
}
},
jshint: {
options: {
browser: true,
node: true
},
all: ['src/*.js', 'test/*.js']
},
simplemocha: {
options: {
ui: 'bdd',
reporter: 'min'
},
all: { src: ['test.js'] }
},
browserify: {
test: {
files: {
'./stage/test.js': ['./test.js'],
},
options: {
debug: true,
ignore: ['domain', 'loggly', 'ga']
},
}
},
shell: {
browserify:{
command: 'node ./node_modules/browserify/bin/cmd.js --debug -o ./stage/test.js -i domain -i loggly -i ga -i pouchdb -i "./test.js" -e ./test.js;',
stdout: true,
stderr: true,
failOnError: true
},
buildStage:{
command: 'rm -rf stage; mkdir stage;cp -av web/ stage; rm -rf bin; mkdir bin;',
stdout: true,
stderr: true,
failOnError: true
},
publish:{
command: 'npm publish;',
stdout: true,
stderr: true,
failOnError: true
}
},
karma: {
local: {
configFile: 'karma.conf.js',
singleRun: true,
browsers: ['Safari']
}
}
});
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('install', 'shell:buildStage');
grunt.registerTask('test', ['jshint','simplemocha','browserify', 'karma']);
grunt.registerTask('development',[]);
grunt.registerTask('production', []);
grunt.registerTask('publish', ['bumpup:patch', 'shell:publish']);
};