forked from xeolabs/xeogl
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
91 lines (86 loc) · 2.57 KB
/
gulpfile.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
90
91
var gulp = require('gulp');
var yuidoc = require("gulp-yuidoc"); // https://www.npmjs.com/package/gulp-yuidoc
const rollup = require('rollup');
const path = require('path');
const license = require('rollup-plugin-license');
gulp.task('docs', function (done) {
gulp.src([
"./src/**/*.js",
'examples/js/animation/*.js',
'examples/js/annotations/*.js',
'examples/js/controls/*.js',
'examples/js/effects/*.js',
'examples/js/curves/*.js',
'examples/js/generation/*.js',
'examples/js/skyboxes/*.js',
'examples/js/stories/*.js',
'examples/js/geometry/*.js',
'examples/js/models/*.js',
'examples/js/helpers/*.js'
])
.pipe(yuidoc.parser())
.pipe(yuidoc.generator({
themedir: "yuiDocThemes/xeogl",
paths: [
'src',
'examples/js/animation',
'examples/js/annotations',
'examples/js/controls',
'examples/js/effects',
'examples/js/curves',
'examples/js/generation',
'examples/js/skyboxes',
'examples/js/stories',
'examples/js/geometry',
'examples/js/models',
'examples/js/helpers'
],
outdir: './docs/',
exclude: "renderer, utils"
}))
.pipe(gulp.dest("./docs"));
});
gulp.task('bundle-umd', () => {
return rollup.rollup({
input: './src/xeogl.js',
plugins: [
license({
banner: {
file: path.join(__dirname, 'BANNER'),
encoding: 'utf-8' // Default is utf-8
}
})
]
}).then(bundle => {
return bundle.write({
file: './build/xeogl.js',
format: 'umd',
name: 'xeogl',
sourcemap: false
});
});
});
gulp.task('bundle-es', () => {
return rollup.rollup({
input: './src/xeogl.js',
plugins: [
license({
banner: {
file: path.join(__dirname, 'BANNER'),
encoding: 'utf-8' // Default is utf-8
}
})
]
}).then(bundle => {
return bundle.write({
file: './build/xeogl.module.js',
format: 'es',
name: 'xeogl',
sourcemap: false
});
});
});
gulp.task('website', () => {
gulp.src(['website/**/*']).pipe(gulp.dest('.'));
});
gulp.task('default', ['bundle-umd', 'bundle-es', 'docs']);