forked from gucong3000/H5F
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
76 lines (69 loc) · 1.6 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
/*global module:false*/
module.exports = function(grunt) {
var browsers = grunt.file.readJSON("sauce-browsers.json");
// Project configuration.
grunt.initConfig({
qunit: {
files: ['test/**/*.html']
},
connect: {
server: {
options: {
base: "",
port: 9999
}
}
},
'saucelabs-qunit': {
all: {
options: {
urls: ["http://127.0.0.1:9999/test/H5F.html"],
tunnelTimeout: 5,
build: process.env.TRAVIS_JOB_ID,
concurrency: 2,
browsers: browsers,
testname: "qunit tests",
tags: ["master"]
}
}
},
watch: {
files: '<config:lint.files>',
tasks: 'lint qunit'
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'src/{,*/}*.js',
'test/{,*/}*.js'
]
},
uglify: {
options: {
stripbanners: true,
banner: '<%= banner%>',
mangle: {
except: ['H5F']
},
preserveComments: 'some'
},
dist: {
src: [
'src/H5F.js'
],
dest: 'h5f.min.js'
}
}
});
// Load required contrib packages
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Default task.
grunt.registerTask('default', ['jshint', 'qunit', 'uglify']);
// Sauce labs CI task
grunt.registerTask("sauce", ["connect", "saucelabs-qunit"]);
// Travis CI task.
grunt.registerTask('travis', ['jshint', 'sauce']);
};