-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathGruntFile.js
98 lines (91 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
89
90
91
92
93
94
95
96
97
98
/* global module:false */
"use strict";
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
base: '.',
port: 8080
}
}
},
'saucelabs-qunit': {
all: {
options: {
username: 'indexeddbshim',
key: process.env.SAUCE_ACCESS_KEY || '',
tags: ['master'],
urls: ['http://127.0.0.1:8080/test/index.html'],
browsers: [{
browserName: 'chrome'
}, {
browserName: 'internet explorer',
platform: 'Windows 2012',
version: '10'
}
]
}
}
},
jshint: {
all: {
files: {
src: ['Gruntfile.js', 'test/**/*.js']
},
options: {
jshintrc: '.jshintrc'
}
}
},
groundskeeper: {
main: {
files: {
'dist/jquery.indexeddb.js': ['src/jquery.indexeddb.js']
},
options: {
'console': false,
'debugger': false
}
}
},
uglify: {
options: {
report: 'gzip',
banner: '/*! <%= pkg.name %> v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
sourceMap: 'dist/<%= (pkg.name).replace(/-/g, ".") %>.min.map',
sourceMapRoot: 'http://nparashuram.com/jquery-indexeddb/',
sourceMappingURL: 'http://nparashuram.com/jquery-indexeddb/dist/<%=pkg.name%>.min.map'
},
main: {
files: {
'dist/<%= (pkg.name).replace(/-/g, ".")%>.min.js': ['dist/jquery.indexeddb.js']
}
}
},
watch: {
all: {
files: ['src/*.js'],
tasks: ['uglify']
}
},
clean: {
dist: ['./dist']
}
});
// Loading dependencies
for (var key in grunt.file.readJSON('package.json').devDependencies) {
if (key !== 'grunt' && key.indexOf('grunt') === 0) {
grunt.loadNpmTasks(key);
}
}
var testJobs = ["build", "connect"];
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined') {
testJobs.push("saucelabs-qunit");
}
grunt.registerTask('build', ['jshint', 'groundskeeper', 'uglify']);
grunt.registerTask('test', testJobs);
grunt.registerTask('default', 'build');
grunt.registerTask('dev', ['build', 'connect', 'watch']);
};