forked from imperavi/kube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
63 lines (50 loc) · 1.58 KB
/
gulpfile.babel.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
const gulp = require('gulp');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const babel = require('gulp-babel');
const sass = require('gulp-sass');
const autoprefixer = require('gulp-autoprefixer');
const minify = require('gulp-clean-css');
const settings = {
dest: 'dist',
}
const files = {
scripts: [
],
styles: [
'src/flexbox-grid/dist/flexboxgrid.css',
'src/kube/src/kube.scss',
],
}
// JavaScript: concat files together, compile es2015 to es5, minify
gulp.task('scripts', function() {
return gulp.src( files.scripts )
.pipe(concat( 'app.js' ))
.pipe(babel())
.pipe(gulp.dest( settings.dest ))
.pipe(rename( 'app.min.js' ))
.pipe(uglify())
.pipe(gulp.dest( settings.dest ));
});
// CSS/SASS: compile scss to css, autoprefix, minify
gulp.task('sass', function () {
return gulp.src( files.styles )
.pipe(sass().on('error', sass.logError))
.pipe(concat( 'kube-flexbox.scss' ))
.pipe(gulp.dest( settings.dest ))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(rename('kube-flexbox.css'))
.pipe(gulp.dest( settings.dest ))
.pipe(rename('kube-flexbox.min.css'))
.pipe(minify({compatibility: 'ie8'}))
.pipe(gulp.dest( settings.dest ));
});
gulp.task('watch', function() {
gulp.watch( files.scripts, ['scripts']);
gulp.watch( files.styles, ['sass']);
});
gulp.task('default', ['sass', 'scripts', 'watch']);