-
Notifications
You must be signed in to change notification settings - Fork 136
/
gulpfile.js
71 lines (63 loc) · 1.95 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
//Basic build process. Nothing too fancy
const gulp = require('gulp-help')(require('gulp')),
concat = require('gulp-concat'),
prettify = require('gulp-jsbeautifier'),
minify = require('gulp-minify'),
jsdoc = require("gulp-jsdoc"),
pkg = require('./package.json'),
template = require('gulp-template'),
babel = require('gulp-babel'),
gutil = require('gulp-util');
const opts = {
showPrivate: true,
monospaceLinks: true,
cleverLinks: true,
outputSourceFiles: true
};
// TODO: Make custom jsdoc template
const tpl = {
path: 'ink-docstrap',
systemName: pkg.name,
footer: 'Generated with gulp',
copyright: 'Copyright WebItUp 2014',
navType: 'vertical',
theme: 'spacelab',
linenums: true,
collapseSymbols: false,
inverseNav: false
};
gulp.task('build', 'Runs build process', () => {
return gulp.src(['./src/constants/start.js','./src/*.js','./src/constants/end.js'])
.pipe(concat('anything.js'))
.pipe(babel({
compact:false,
presets: ['es2015']
}))
.pipe(prettify())
.pipe(minify({
ext:{
src: '.js',
min: '.min.js'
}
}).on('error', gutil.log))
.pipe(gulp.dest('./dist/'));
});
gulp.task('jsdoc', 'Generates jsdoc documentation', ['build'], () => {
gulp.src(['README.md', './dist/anything.js'])
.pipe(template({pkg: pkg}))
.pipe(jsdoc.parser({
name: pkg.name,
description: pkg.description,
version: pkg.version,
licenses: [pkg.license]
}))
.pipe(jsdoc.generator('./docs', tpl, opts));
});
gulp.task('fuck', 'JSFucks allt the code',() => {
const jsfuck = require('gulp-jsfuck');
return gulp.src(['./src/constants/start.js','./src/*.js','./src/constants/end.js'])
.pipe(concat('anything.fucked.js'))
.pipe(jsfuck())
.pipe(gulp.dest('./dist/'));
});
gulp.task('default', false, ['help']);