-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
85 lines (74 loc) · 1.99 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
module.exports = function(grunt) {
/* Inject our "esquire-mocha" task */
require("./ext/grunt.js")(grunt);
/* Grunt initialization */
grunt.initConfig({
/* Unit testing */
'karma': {
'default': {
configFile: 'karma.conf.js',
runnerPort: 9999,
singleRun: true,
browsers: ['PhantomJS', 'Chrome', 'Firefox', 'Safari'],
logLevel: 'ERROR'
},
},
/* Simple mocha */
"esquire-mocha": {
'default': {
src: [ 'test/node.test.js',
'test/deferred.test.js',
'test/promise.test.js',
'test/esquire.test.js',
'test/global.test.js',
'test/modules/*.js' ]
}
},
/* Uglify task */
'uglify': {
'inject': {
src: 'src/esquire.js',
dest: 'esquire.min.js'
},
'defaut': {
src: [ 'src/esquire.js', 'src/loader.js' ],
dest: 'esquire-full.min.js'
}
},
/* Documentation task */
'jsdoc-ng' : {
'dist' : {
src: ['src/**/*.js', 'src/**/*.jsdoc', 'README.md' ],
dest: 'docs',
template : 'jsdoc-ng',
options: {
"plugins": ["plugins/markdown"],
"templates": {
"cleverLinks": true,
"windowTitle": "Esquire v." + require('./package.json').version
},
"markdown": {
"parser": "gfm",
"hardwrap": true
}
}
}
},
/* Publish GirHub Pages */
'gh-pages': {
src: '**/*',
'options': {
base: 'docs'
}
}
});
/* Load our plugins */
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsdoc-ng');
grunt.loadNpmTasks('grunt-gh-pages');
/* Default task: requirejs then uglify */
grunt.registerTask('default', ['test', 'uglify']);
grunt.registerTask('test', ['karma', 'esquire-mocha', 'uglify']);
grunt.registerTask('docs', ['jsdoc-ng', 'gh-pages']);
};