forked from denull/Az.js
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
43 lines (41 loc) · 1.36 KB
/
gulpfile.js
File metadata and controls
43 lines (41 loc) · 1.36 KB
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
var gulp = require('gulp'),
gutil = require('gulp-util'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
filesize = require('gulp-filesize'),
sourcemaps = require('gulp-sourcemaps'),
jsdoc2md = require('gulp-jsdoc-to-markdown'),
merge = require('merge-stream'),
fs = require('fs');
ts = require("gulp-typescript");
tsProject = ts.createProject("./tsconfig.json");
terser = require('gulp-terser');
gulp.task('docs', function () {
return merge(
tsProject.src(['src/az.tokens.ts', 'src/az.morph.ts'])
.pipe(jsdoc2md({ template: fs.readFileSync('./api.hbs', 'utf8') }))
.on('error', function (err) {
gutil.log(gutil.colors.red('jsdoc2md failed'), err.message)
})
.pipe(rename(function (path) {
path.basename = path.basename.split('.').map(function(part) {
return part[0].toLocaleUpperCase() + part.substr(1);
}).join('.');
path.extname = '.md'
}))
.pipe(gulp.dest('wiki')),
gulp.src('README.md')
.pipe(rename(function (path) {
path.basename = 'Home';
}))
.pipe(gulp.dest('wiki'))
);
});
gulp.task('default', function() {
return tsProject.src(['src/az.ts', 'src/az.*.ts'])
.pipe(tsProject())
.pipe(terser())
.pipe(gulp.dest('dist'))
.on('error', gutil.log);
});