Skip to content

Instantly share code, notes, and snippets.

@alemohamad
Created May 16, 2019 16:37
Show Gist options
  • Save alemohamad/79ba208735cf4d58cc1a9150ac73f5bb to your computer and use it in GitHub Desktop.
Save alemohamad/79ba208735cf4d58cc1a9150ac73f5bb to your computer and use it in GitHub Desktop.
Gulp example file
const { src, dest, parallel } = require('gulp');
const pug = require('gulp-pug');
const less = require('gulp-less');
const minifyCSS = require('gulp-csso');
const concat = require('gulp-concat');
function html() {
return src('client/templates/*.pug')
.pipe(pug())
.pipe(dest('build/html'))
}
function css() {
return src('client/templates/*.less')
.pipe(less())
.pipe(minifyCSS())
.pipe(dest('build/css'))
}
function js() {
return src('client/javascript/*.js', { sourcemaps: true })
.pipe(concat('app.min.js'))
.pipe(dest('build/js', { sourcemaps: true }))
}
exports.js = js;
exports.css = css;
exports.html = html;
exports.default = parallel(html, css, js);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment