Answer the question
In order to leave comments, you need to log in
Gulp WireDep - why styles and scripts are not collected in one file?
Hello. I recently started learning Gulp with tutorials from Loftblog. Stuck on the fifth lesson, because. Unable to merge required files into one. My default task:
var gulp = require('gulp');
var jade = require('gulp-jade');
var wiredep = require('wiredep').stream;
...
var config = require('./config');
var path = require('./paths');
...
gulp.task('build', ['clean', 'html', 'styles', 'scripts']);
gulp.task('watch', function() {
gulp.watch(path.src.jade, ['html']);
gulp.watch(path.src.stylus, ['styles']);
gulp.watch(path.src.stylus, ['scripts']);
});
gulp.task('default', ['connect', 'build', 'watch']);
gulp.task('html', function () {
return gulp.src(path.src.jade)
.pipe(jade(config.jade))
.pipe(wiredep(config.wiredep))
.pipe(gulp.dest(path.build.html))
.pipe(connect.reload());
});
src/index.jade
:doctype html
- var cssFolder = "assets/css/"
html
head
title Document
meta(charset="utf-8")
// build:css(.) assets/css/vendor.css
// bower:css
// endbower
// endbuild
body
header
h1 Test
p.
Lorem Ipsum - это текст-"рыба"
footer
// build:js(.) assets/js/vendor.js
// bower:js
// endbower
// endbuild
build:js(.) assets/js/vendor.js
andbuild:js assets/js/vendor.js
Answer the question
In order to leave comments, you need to log in
wiredep takes the bower files that are listed in the dependencies. First you need to make sure that these dependencies are in bower.json, i.e. have you installed all bower plugins with the --save option. If there is no bower.json file itself, then run the bower init command and it will appear
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question