-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgulpfile.js
44 lines (37 loc) · 1.27 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
const gulp = require('gulp');
const mocha = require('gulp-mocha');
const uglify = require('gulp-uglifyjs');
const concat = require('gulp-concat');
const exit = require('gulp-exit');
const ejsmin = require('gulp-ejsmin');
const babel = require('gulp-babel');
const gutil = require('gulp-util');
const through = require('through2')
gulp.task('minify-ejs-pages', () => {
return gulp.src('views/pages/*.ejs')
.pipe(ejsmin())
.pipe(gulp.dest('.viewsMin/pages'))
});
gulp.task('minify-ejs-snippets', () => {
return gulp.src('views/snippets/*.ejs')
.pipe(ejsmin())
.pipe(gulp.dest('.viewsMin/snippets'))
});
gulp.task('specnyan', ['default', 'testEnv'], () => {
return gulp.src('spec/deadbird.js', {read: false})
.pipe(mocha({require: ['mocha-clean'], reporter: 'nyan'}))
.pipe(exit());
});
gulp.task('spec', ['default', 'testEnv'], () => {
return gulp.src('spec/deadbird.js', {read: false})
.pipe(mocha({require: ['mocha-clean'], reporter: 'spec'}))
.pipe(exit());
});
gulp.task('es6toes5', () => {
return gulp.src('src/js/*.js')
.pipe(babel({
presets: ["es2015-without-strict"]
}).on('error', console.log))
.pipe(gulp.dest('public/js'))
});
gulp.task('default', ['minify-ejs-pages', 'minify-ejs-snippets', 'es6toes5']);