-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
72 lines (56 loc) · 1.3 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
//==============//
// DEPENDENCIES //
//==============//
var pkg = require('./package.json');
var del = require('del');
var gulp = require('gulp');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var header = require('gulp-header');
var fs = require('fs');
var deploy = require('gulp-gh-pages');
var debug = require('gulp-debug');
//=========//
// GLOBALS //
//=========//
//=======//
// CLEAN //
//=======//
gulp.task('clean', function (callback) {
del(['dist'], callback);
});
//=======//
// BUILD //
//=======//
gulp.task('build', ['clean'], function () {
var banner = fs.readFileSync('src/header.js', 'utf8');
gulp
.src([
'./src/index.js'
])
.pipe(concat('baseline-element.js'))
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'))
.pipe(uglify())
.pipe(rename('baseline-element.min.js'))
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'))
.on('error', gutil.log)
;
});
//=======//
// DEMOS //
//=======//
gulp.task('demo-deploy', function () {
return gulp.src('./demo/**/*.*')
.pipe(debug({
title: 'Deploy'
}))
.pipe(deploy());
});
//==============//
// DEFAULT TASK //
//==============//
gulp.task('default', ['build']);