-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
83 lines (74 loc) · 2.35 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
var tasks = require('./gruntTasks'),
browsers = tasks.browsers,
port = 8888;
module.exports = function(grunt) {
grunt.registerTask('coverage', 'build coverage', function(){
var done = this.async();
tasks.buildCoverage(done);
});
grunt.registerTask('docs', 'build docs', function(){
var done = this.async();
tasks.buildDocs(done);
});
grunt.registerTask('publish', 'publish version', tasks.publishVersion);
grunt.initConfig({
exec: {
buildSrc: {
cmd: 'node_modules/.bin/browserify --debug lib/luc.js > build/luc.js'
},
buildShim: {
cmd: 'node_modules/.bin/browserify --debug node_modules/es5-shim-sham/index.js lib/luc.js > build/luc-es5-shim.js'
},
buildTest: {
cmd: 'node_modules/.bin/browserify --debug --im node_modules/es5-shim-sham/index.js test/lib/luc.js > pages/testRunner/build/tests.js'
},
runTest: {
cmd: 'node_modules/.bin/mocha -R list'
}
},
uglify: {
compress: {
files: {
'build/luc.min.js': ['build/luc.js'],
'build/luc-es5-shim.min.js': ['build/luc-es5-shim.js']
},
options: {
mangle: false,
preserveComments: 'some',
banner: '/**\n' +
' * @license https://github.com/pllee/luc/blob/master/LICENSE\n' +
' * @version ' + require('./package').version + '\n' +
' */\n'
}
}
},
connect: {
server: {
options: {
base: "",
port: port
}
}
},
'saucelabs-mocha': {
all: {
options: {
urls: ['http://localhost:' + port + '/pages/testRunner/'],
tunnelTimeout: 5,
build: process.env.TRAVIS_JOB_ID,
concurrency: 3,
browsers: browsers,
testname: 'luc tests ' + new Date(),
tags: ['master']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-devtools');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['exec', 'uglify']);
grunt.registerTask('test', ['default', 'connect', 'saucelabs-mocha']);
};