Created
May 16, 2019 16:37
-
-
Save alemohamad/79ba208735cf4d58cc1a9150ac73f5bb to your computer and use it in GitHub Desktop.
Gulp example file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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