Open delch opened 8 years ago
Same problem here, seems the thing doesn't work.
I can't reproduce the error, everything works fine on my end. Can you setup a simple project where the problem occurs so I can debug?
//e: Try to make ../components/**/*.jade
a placeholder (see advanced example in README)
@CREEATION thanks for getting in touch, please check: https://github.com/sanjinc/gulp-jade-globbing-test
I tried with a placeholder, and I get the same error - like nothing changed in the pipeline:
ENOENT, no such file or directory '/Volumes/HDD/Sites/_test/jadeglobbingtest/templates/{alltemplates}.jade'
Wow. Finally, I tracked it down to vinyl-map
, see this issue: https://github.com/hughsk/vinyl-map/issues/7.
I updated to vinyl-map2 and am currently working on a patch here: https://github.com/CREEATION/gulp-jade-globbing/tree/vinyl-map-fix
Could you test the vinyl-map-fix branch for me in your real project, not your debug project?
node_modules/gulp-jade-globbing
npm install
in the gulp-jade-globbing
directoryThis setup works for me now:
+ gulp-jade-globbing-test-master/
| gulpfile.js
| package.json
+ views/
| all.jade ....... # without placeholder include
+ templates/
+ 01/
| | one.jade
+ 02/
| | two.jade
+ pages/ ........... # dist
| all.html ....... # if it works :)
include ../templates/**/*.jade
+first
+second
var gulp = require('gulp');
var jade = require('gulp-jade');
var jadeGlobbing = require('gulp-jade-globbing');
// define tasks here
gulp.task('default', function () {
gulp.src('./views/all.jade')
.pipe(jadeGlobbing())
.pipe(jade())
.pipe(gulp.dest('./pages/'));
});
In your test project, this will include all.jade
into all.jade
(at least tries), which causes an error.
I guess you can safely delete the test repo now :smiley_cat:
@CREEATION thanks for the effort!
This fix works, but only for that test scenario. In my real project I have the same problem when I use asterisks in another file (different than the one which gulp executes). I have setup another test example, more closer to real life project and the one I use - please check these two examples.
This one works: https://github.com/sanjinc/gulp-jade-globbing-test/tree/works
This one doesnt work: https://github.com/sanjinc/gulp-jade-globbing-test/tree/works-not
Notice the difference in jade files inside pages directory.
Hello again!
I see the problem here. gulp-jade-globbing
doesn't go through all jade files, only those which are passed through to it.
As all.jade
get's included elsewhere, gulp-jade-globbing
doesn't touch the file and therefore the path doesn't get replaced.
I'm working on the problem, but didn't make much progress yet. Help is always appreciated :)
In the meantime you can use the placeholders as a workaround.
Thanks for double checking that.
Yeah, placeholders will do the trick... now if only Jade would allow absolute path :-)
I will see if I can help somehow.
gulpfile.js
Terminal error: