-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Description
Hi,
I might have discovered a bug. I first thought it might be related to my personal setup, which has become rather big, but this small test-bed has the same results:
var gulp = require('gulp');
var inject = require('gulp-inject');
gulp.task('default', function (cb) {
gulp.src('test/index.html')
.pipe(inject(gulp.src(['test/*.{js,css}']), {
addRootSlash: false,
addPrefix: 'test'
}))
.pipe(gulp.dest('test/out/test-regularl'));
gulp.src('test/index.html')
.pipe(inject(gulp.src(['test/*.{js,css}']), {
addRootSlash: false,
addPrefix: '<?php echo stuff(); ?>'
}))
.pipe(gulp.dest('test/out/test-php'));
cb(null);
});
Test HTML document:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- inject:css --><!-- endinject -->
</head>
<body>
<!-- inject:js --><!-- endinject -->
</body>
</html>
The first run will result in the files being injected as suspected, where the second run will not inject anything. Through trial & error, I managed to deduce that this problem occurs as soon as you insert a ?
into the prefix string.
Edit; In case this might help:
OS X 10.11.1
node v4.1.2
gulp v3.9.0
gulp-inject v3.0.0
Metadata
Metadata
Assignees
Labels
No labels