-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
47 lines (39 loc) · 970 Bytes
/
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
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var babel = require('gulp-babel');
var autoprefixOptions = {
browsers: ['last 2 versions', '> 5%']
};
var input = {
'sass' : 'app/sass/*.scss',
'js' : 'app/js/*.js'
};
var output = {
'css' : 'dist/css',
'js' : 'dist/js'
};
gulp.task('sass', function () {
return gulp
.src(input.sass)
.pipe(sourcemaps.init())
.pipe(sass())
.pipe(sourcemaps.write())
.pipe(autoprefixer(autoprefixOptions))
.pipe(gulp.dest(output.css));
});
gulp.task('js', function () {
return gulp
.src(input.js)
.pipe(sourcemaps.init())
.pipe(babel({
presets: ['es2015']
}))
.pipe(concat('app.js'))
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest(output.js));
});