Skip to content

Instantly share code, notes, and snippets.

@grippado
Last active April 6, 2017 01:19
Show Gist options
  • Save grippado/8c5b42a4b523513f3e208d84ec7a620a to your computer and use it in GitHub Desktop.
Save grippado/8c5b42a4b523513f3e208d84ec7a620a to your computer and use it in GitHub Desktop.
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