-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
28 lines (23 loc) · 918 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
const gulp = require('gulp');
const sass = require('gulp-sass');
const gutil = require('gulp-util');
const autoprefixer = require('gulp-autoprefixer');
const sassSource = './assets/sass/yuiko.scss';
const sassDestination = './public/styles';
const sassOptions = { dev: { outputStyle: 'expanded' }, prod: { outputStyle: 'compressed' }};
gulp.task('sass', () => {
return gulp.src(sassSource)
.pipe(sass(sassOptions.dev).on('error', sass.logError))
.pipe(gulp.dest(sassDestination));
});
gulp.task('watch', () => {
return gulp.watch(sassSource, ['sass'])
.on('change', event => gutil.log(`File ${event.path} was ${event.type}, running tasks...`));
});
gulp.task('prod', () => {
return gulp.src(sassSource)
.pipe(sass(sassOptions.prod).on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gulp.dest(sassDestination));
});
gulp.task('default', ['sass']);