forked from niclasleonbock/hacktoberfest-status
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
52 lines (45 loc) · 1.31 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
49
50
51
52
const gulp = require('gulp');
const autoprefixer = require('gulp-autoprefixer');
const sass = require('gulp-sass');
const cleanCss = require('gulp-clean-css');
// config
const paths = {
src: {
sass: 'resources/assets/sass/',
fonts: 'resources/assets/fonts/',
images: 'resources/assets/images/',
},
dist: {
css: 'public/css/',
fonts: 'public/fonts/',
images: 'public/images/',
}
};
// sass
gulp.task('sass', function () {
return gulp.src([paths.src.sass + 'app.scss', paths.src.sass + 'preload.scss'])
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 4 versions'],
cascade: false
}))
.pipe(cleanCss({
compatibility: 'ie8'
}))
.pipe(gulp.dest(paths.dist.css));
});
gulp.task('sass:watch', function () {
gulp.watch(paths.src.sass + '**/*.scss', ['sass']);
});
// copy tasks
gulp.task('copy:fonts', function () {
gulp.src(paths.src.fonts + '**/*.{ttf,woff,woff2,eof,svg}')
.pipe(gulp.dest(paths.dist.fonts));
});
gulp.task('copy:images', function () {
gulp.src(paths.src.images + '**/*.{png,jpg,svg}')
.pipe(gulp.dest(paths.dist.images));
});
gulp.task('copy', ['copy:fonts', 'copy:images']);
gulp.task('default', ['sass', 'copy']);
gulp.task('watch', ['sass:watch'])