forked from Aintaer/nbd.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
86 lines (82 loc) · 2.08 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
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
build: ['dist']
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
test: [
'*.js',
'Model/**/*.js',
'View/**/*.js',
'Controller/**/*.js',
'trait/**/*.js',
'util/**/*.js'
],
},
requirejs: {
build: {
options: {
"baseUrl": ".",
"optimize": "none",
"name": "index",
"useStrict": true,
"include": ["node_modules/almond/almond"],
"wrap": {
"start": "(function(root) {",
"end": "return root.nbd = require('index'); })(this);"
},
"out": "dist/nbd.js"
}
}
},
uglify: {
build: {
options: {
report: 'gzip'
},
files: {
'dist/nbd.min.js': ['dist/nbd.js']
}
}
},
karma: {
options: {
configFile: 'test/karma.conf.js',
singleRun: true
},
persistent: {
singleRun: false
},
single: {
browsers: ['PhantomJS']
},
multi: {
reporters: ['dots'],
browsers: ['PhantomJS', 'Firefox'/*, 'Chrome'*/]
}
},
promises: {
adapter: './test/lib/promise-adapter'
}
});
grunt.registerTask('promises', 'Promises A+ Tests', function() {
var adapterFile = grunt.config(['promises', 'adapter']),
adapter = require(adapterFile),
aplus = require('promises-aplus-tests');
aplus(adapter, {}, this.async());
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('build', ['clean:build', 'requirejs:build', 'uglify:build']);
grunt.registerTask('test', ['karma:persistent']);
grunt.registerTask('travis', ['jshint', 'karma:multi', 'promises']);
grunt.registerTask('default', ['jshint', 'build']);
};