Last active
April 6, 2017 01:19
-
-
Save grippado/8c5b42a4b523513f3e208d84ec7a620a to your computer and use it in GitHub Desktop.
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
var gulp = require('gulp'), | |
flatten = require('gulp-flatten'); | |
// Estrutura da pasta | |
const srcPaths = { | |
html: 'src/pug/**/*.pug', | |
exclude: '!src/pug/layouts/inc/*.pug' | |
}; | |
const buildPaths = { | |
html: './build/', | |
}; | |
gulp.task('default', ['html','w']); | |
// Task | |
gulp.task('html', () => { | |
gulp.src([ | |
srcPaths.html, | |
srcPaths.exclude | |
]) | |
//.pipe(plumber()) | |
.pipe(pug({ | |
pretty: true | |
})) | |
.on('error', onError) | |
.pipe(flatten()) | |
.pipe( | |
gulp.dest( | |
buildPaths.html | |
) | |
); | |
}); | |
// WATCH | |
gulp.task('w',['html'], function() { | |
gulp.watch(srcPaths.html, ['html']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment