Shian/gulpfile.js

32 lines
766 B
JavaScript
Raw Normal View History

2021-04-14 05:11:10 +00:00
const {series, watch, src, dest, parallel} = require('gulp');
const sass = require('gulp-sass');
const livereload = require('gulp-livereload');
const zip = require('gulp-zip');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const cleancss = require('gulp-clean-css');
function serve(done) {
livereload.listen();
done();
}
function css () {
2021-04-14 09:40:15 +00:00
return src('src/sass/*.scss')
2021-04-14 05:11:10 +00:00
.pipe(sass().on('error', sass.logError))
.pipe(cleancss({compatibility: 'ie8'}))
.pipe(dest('dist/'))
.pipe(livereload())
}
const cssWatcher = () => watch('src/sass/**', css);
const watcher = cssWatcher;
const build = css;
const dev = series(build, serve, watcher);
exports.build = build;
exports.dev = dev;
exports.default = build;