forked from hefuPaymentService/webgl-fundamentals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
90 lines (79 loc) · 2.17 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
87
88
89
"use strict";
const path = require('path');
const fs = require('fs');
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
const s_ignoreRE = /\.(md|py|sh|enc)$/i;
function noMds(filename) {
return !s_ignoreRE.test(filename);
}
function notFolder(filename) {
return !fs.statSync(filename).isDirectory();
}
function noMdsNoFolders(filename) {
return noMds(filename) && notFolder(filename);
}
grunt.initConfig({
eslint: {
lib: {
src: [
'webgl/resources/webgl-utils.js',
'webgl/resources/webgl-lessons-helper.js',
'webgl/resources/primitives.js',
'webgl/resources/2d-math.js',
'webgl/resources/3d-math.js',
],
options: {
config: 'build/conf/eslint.json',
//rulesdir: ['build/rules'],
},
},
//examples: {
// src: [
// 'webgl/*.html',
// ],
// options: {
// configFile: 'build/conf/eslint-examples.json',
// },
//},
},
jsdoc: {
docs: {
src: [
'webgl/resources/primitives.js',
'webgl/resources/webgl-2d-math.js',
'webgl/resources/webgl-3d-math.js',
'webgl/resources/webgl-utils.js',
'docs.md',
],
options: {
destination: 'out/docs',
configure: 'build/conf/jsdoc.conf.json',
template: './node_modules/minami',
},
},
},
copy: {
main: {
files: [
{ expand: false, src: '*', dest: 'out/', filter: noMdsNoFolders, },
{ expand: true, src: 'webgl/**', dest: 'out/', filter: noMds, },
{ expand: true, src: 'monaco-editor/**', dest: 'out/', },
{ expand: true, src: '3rdparty/**', dest: 'out/', },
],
},
},
clean: [
'out/**/*',
],
});
grunt.registerTask('buildlessons', function() {
var buildStuff = require('./build/js/build');
var finish = this.async();
buildStuff().then(function() {
finish();
}).done();
});
grunt.registerTask('build', ['clean', 'copy', 'buildlessons']);
grunt.registerTask('default', ['eslint', 'build', 'jsdoc']);
};