-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (43 loc) · 1.29 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');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var minify = require('gulp-minify');
var cleancss = require('gulp-clean-css');
var rename = require('gulp-rename');
var config = {
bowerDir: './bower_components',
publicDir: './website/static',
root: '.'
};
gulp.task('fonts', function() {
return gulp.src([
config.bowerDir + '/bootstrap/fonts/**/*',
])
.pipe(gulp.dest(config.publicDir + '/fonts'));
});
gulp.task('js', function() {
return gulp.src([
config.bowerDir + '/bootstrap/dist/js/*.js',
config.bowerDir + '/bootstrap/assets/js/vendor/popper.min.js',
config.bowerDir + '/jquery/dist/jquery.slim.min.js',
])
.pipe(sourcemaps.write(config.publicDir + '/js'))
.pipe(gulp.dest(config.publicDir + '/js'));
});
gulp.task('css', function() {
gulp.src([
config.bowerDir + '/bootstrap/scss/*.scss',
])
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'compressed',
includePaths: [config.bowerDir + '/bootstrap/scss'],
}))
.pipe(rename({suffix: '.min'}))
.pipe(cleancss({specialComments: 0}))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.publicDir + '/css'));
});
gulp.task('default', ['css', 'js', 'fonts']);