-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
48 lines (44 loc) · 1.36 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
module.exports = function (grunt) {
'use strict';
function getTypeDocPath() {
var fs = require('fs');
return fs.existsSync('./local.json') ? require('./local.json').typeDocPath : 'typedoc/src/';
}
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
rootfiles: {
src: ['README.md', 'LICENCE*'],
dest: 'dist/'
}
},
'typedoc': {
options: {
out: 'dist',
name: 'TypeDoc API Documentation',
hideGenerator: true,
entryPoint: 'td',
readme: 'none',
gaID: 'UA-53674298-1',
gaSite: 'typedoc.io',
theme: 'theme',
mode: 'File'
},
src: getTypeDocPath()
},
'gh-pages': {
'dist': {
options: {
base: 'dist/'
},
src: '**/*'
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('typedoc');
grunt.registerTask('build', 'Create api documentation', ['typedoc', 'copy']);
grunt.registerTask('publish', 'Publish to typedoc.io/api', ['build', 'gh-pages']);
grunt.registerTask('default', ['build']);
};