forked from Aerolab/blockrain.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (46 loc) · 1.49 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
var gulp = require('gulp'),
fs = require('fs'),
uglify = require("gulp-uglify"),
concat = require("gulp-concat"),
header = require("gulp-header"),
zip = require("gulp-zip"),
runSequence = require('run-sequence');
var getVersion = function () {
info = require("./package.json");
return info.version;
};
var getCopyright = function () {
return fs.readFileSync('Copyright');
};
gulp.task('js', function () {
// Concatenate and Minify JS
return gulp.src(['./src/blockrain.jquery.libs.js', './src/blockrain.jquery.src.js', './src/blockrain.jquery.themes.js'])
.pipe(concat('blockrain.jquery.js'))
.pipe(header(getCopyright(), {version: getVersion()}))
.pipe(gulp.dest('./dist'))
.pipe(uglify({preserveComments:'none'}))
.pipe(concat('blockrain.jquery.min.js'))
.pipe(header(getCopyright(), {version: getVersion()}))
.pipe(gulp.dest('./dist'));
});
gulp.task('css', function () {
// CSS
return gulp.src(['./src/blockrain.css'])
.pipe(gulp.dest('./dist'));
});
gulp.task('readme', function () {
// Readme
return gulp.src(['./README.md'])
.pipe(gulp.dest('./dist'));
});
gulp.task('dist', function () {
// Create a ZIP File
return gulp.src(['./dist/blockrain.jquery.js', './dist/blockrain.jquery.min.js', './dist/blockrain.css'])
.pipe(zip('blockrain.zip'))
.pipe(gulp.dest('./dist'));
});
gulp.task('build', function(callback){
runSequence('js', 'css', 'readme', 'dist',
callback);
});
gulp.task('default', ['build']);