-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
43 lines (37 loc) · 995 Bytes
/
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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var wrap = require('gulp-wrap');
var stripDebug = require('gulp-strip-debug');
var distFolder = './dist';
var files = [
'./src/response.js',
'./src/request.js',
'./src/github.js',
'./src/repo-element.js'
];
var wrapper = [
'(function() {',
'"use strict";',
'<%= contents %>',
'}.bind(typeof window !== "undefined" ? window : {})());'
].join('\n');
gulp.task('build', ['standalone', 'bundled']);
gulp.task('standalone', function() {
gulp.src(files)
.pipe(stripDebug())
.pipe(concat('github-element.js'))
.pipe(wrap(wrapper))
.pipe(uglify())
.pipe(gulp.dest(distFolder));
});
gulp.task('bundled', function() {
gulp.src([
'./bower_components/skatejs/dist/skate.js'
].concat(files))
.pipe(stripDebug())
.pipe(concat('github-element-bundled.js'))
.pipe(wrap(wrapper))
.pipe(uglify())
.pipe(gulp.dest(distFolder));
});