Answer the question
In order to leave comments, you need to log in
How to configure Gulp so that it knows what to take and where and how to give?
Translate gulp the following, I can't anymore:
1. Dear gulp, please take this dev/pug/*.pug and save it to dist .
Now, kindly save this dev/pug/pages/*.pug to dist/pages .
Thanks Gulp!
Taxi PUG:
const gulp = require('gulp');
const htmlValidator = require('gulp-w3c-html-validator');
const plumber = require('gulp-plumber');
const pug = require('gulp-pug');
const argv = require('yargs').argv;
const gulpif = require('gulp-if');
// Ебашим Pug в HTML
module.exports = function pug2html() {
return gulp.src('dev/pug/*.pug')
.pipe(plumber())
.pipe(pug())
.pipe(plumber.stop())
.pipe(gulpif(argv.prod, htmlValidator()))
.pipe(gulp.dest('dist'))
};
const gulp = require('gulp');
const htmlValidator = require('gulp-w3c-html-validator');
const plumber = require('gulp-plumber');
const pug = require('gulp-pug');
const argv = require('yargs').argv;
const gulpif = require('gulp-if');
// Ебашим Pug в HTML
module.exports = function pug2html() {
return gulp.src(['dev/pug/*.pug', 'dev/pug/pages/*.pug'])
.pipe(plumber())
.pipe(pug())
.pipe(plumber.stop())
.pipe(gulpif(argv.prod, htmlValidator()))
.pipe(gulp.dest('dist'))
};
Answer the question
In order to leave comments, you need to log in
It helped 'dev/pug/!(helpers|layout)**/*pug' - exclude folders !(helpers|layout)
module.exports = function pug2html() {
return gulp.src([
'dev/pug/*pug',
'dev/pug/!(helpers|layout)**/*pug'
])
.pipe(plumber())
.pipe(pug())
.pipe(plumber.stop())
.pipe(gulpif(argv.prod, htmlValidator()))
.pipe(gulp.dest('dist'))
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question