-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
44 lines (37 loc) · 1.09 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
'use strict';
import gulp from 'gulp';
import sass from 'gulp-sass';
import babel from 'gulp-babel';
import rename from 'gulp-rename';
import autoprefixer from 'gulp-autoprefixer';
import fileinclude from 'gulp-file-include';
import cssBase64 from 'gulp-css-base64';
import uglify from 'gulp-uglify';
import cssmin from 'gulp-cssmin';
gulp.task('sass', () => {
return gulp.src('./src/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(cssBase64())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(cssmin())
.pipe(rename((path) => {
path.basename = 'open-accessibility.min';
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('js', () => {
return gulp.src('./src/**/*.babel.js')
.pipe(fileinclude())
.pipe(babel({
presets: ['es2015']
}))
.pipe(uglify())
.pipe(rename((path) => {
path.basename = 'open-accessibility.min';
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('default', ['js', 'sass']);