forked from Learnosity/learnosity-demos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (43 loc) · 1.23 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
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minifyCSS = require('gulp-minify-css'),
gulpCopy = require('gulp-copy'),
replace = require('gulp-replace');
// default gulp task
gulp.task(
'default',
[
'scripts',
'styles',
'copy-fonts'
],
function() {}
);
// TASKS...
gulp.task('scripts', function () {
return gulp.src([
'./www/static/vendor/jquery/jquery-1.11.?.min.js',
'./www/static/vendor/bootstrap/js/bootstrap.min.js',
'./www/static/js/prettyPrint.js',
'./www/static/js/main.js'
])
.pipe(concat('all.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./www/static/dist/'));
});
gulp.task('styles', function () {
gulp.src([
'./www/static/vendor/bootstrap/css/bootstrap.min.css',
'./www/static/vendor/ladda/ladda.min.css',
'./www/static/css/main.css'
])
.pipe(concat('all.min.css'))
.pipe(replace('../fonts/', './fonts/'))
.pipe(minifyCSS())
.pipe(gulp.dest('./www/static/dist/'));
});
gulp.task('copy-fonts', function () {
return gulp.src('./www/static/vendor/bootstrap/fonts/*')
.pipe(gulpCopy('./www/static/dist/fonts/', {prefix: 5}));
});