Shian/gulpfile.js

32 lines
768 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 () {
return src('src/sass/app.scss')
.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;