Answer the question
In order to leave comments, you need to log in
How to properly set up gulp-useref for wordpress?
I have a standard wp folder structure
/- wp-content
/themes/
/app/
/bower/ - все что скачено bower
header.php
gulpfile.js - лежит в корне
//useref
gulp.task('html', function () {
var assets = useref.assets({searchPath: '/wp-content/themes/app/'});
return gulp.src('wp-content/themes/app/*.php')
.pipe(assets)
.pipe(gulpif('*.js', uglify()))
.pipe(gulpif('*.css', minifyCss()))
.pipe(assets.restore())
.pipe(useref())
.pipe(gulp.dest('wp-content/themes/dist'));
});
<!-- build:css css/vendor.css -->
<link rel="stylesheet" href="bower/normalize.css/normalize.css" />
<link rel="stylesheet" href="bower/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="bower/components-font-awesome/css/font-awesome.css" />
<link rel="stylesheet" href="bower/owlcar/owl-carousel/owl.carousel.css" />
<!-- endbuild -->
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question