cleaned up and improved gulpfile. now optiosn for clean, css, images or default

merge-requests/208/head
fatchan 5 years ago
parent bf88672766
commit 65db7a1495
  1. 33
      gulpfile.js

@ -13,38 +13,33 @@ const paths = {
images: { images: {
src: 'gulp/res/img/*', src: 'gulp/res/img/*',
dest: 'static/img/' dest: 'static/img/'
},
scripts: {
src: 'gulp/res/js/*.js',
dest: 'static/js/'
} }
}; };
function clean() { function clean() {
return del([ 'dist' ]); return del([ 'static/html/*' ]);
} }
function styles() { //update the css file
function css() {
return gulp.src(paths.styles.src) return gulp.src(paths.styles.src)
.pipe(less()) .pipe(less())
.pipe(cleanCSS()) .pipe(cleanCSS())
.pipe(gulp.dest(paths.styles.dest)); .pipe(gulp.dest(paths.styles.dest));
} }
function scripts() { //favicon, spoiler image, default banner, spoiler/sticky/sage icons
return gulp.src(paths.scripts.src) function images() {
.pipe(uglify()) return gulp.src(paths.images.src)
.pipe(gulp.dest(paths.scripts.dest)); .pipe(gulp.dest(paths.images.dest));
}
function images() { //basically the favicon and spoiler image
return gulp.src(paths.images.src)
.pipe(gulp.dest(paths.images.dest));
} }
const build = gulp.parallel(css, images);
const build = gulp.parallel(styles, scripts, images); module.exports = {
clean,
module.exports.clean = clean; css,
module.exports.default = build; images,
default: build
};

Loading…
Cancel
Save