-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·31 lines (28 loc) · 1004 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
const gulp = require('gulp')
const sass = require('gulp-sass')(require('sass'))
const sassGlob = require('gulp-sass-glob')
const autoprefixer = require('gulp-autoprefixer')
const gcmq = require('gulp-group-css-media-queries')
const cleanCSS = require('gulp-clean-css')
const minify = require('gulp-minify')
const css = () => gulp.src('./src/sass/*.scss')
.pipe(sassGlob())
.pipe(sass({ outputStyle: 'compressed' }))
.pipe(gcmq())
.pipe(autoprefixer({
overrideBrowserslist: ['last 3 versions'],
cascade: false
}))
.pipe(cleanCSS())
.pipe(gulp.dest('./dist/css/'))
const js = () => gulp.src('./src/js/*.js')
.pipe(minify())
.pipe(gulp.dest('./dist/js/'))
exports.watch = () => {
gulp.watch('./src/sass/**/*.scss', css).on('change', function(path, stats) {
console.log(`File ${path} was removed`);
});
gulp.watch('./src/js/*.js', js).on('change', function(path, stats) {
console.log(`File ${path} was removed`);
});
}