-
Notifications
You must be signed in to change notification settings - Fork 93
injecting into different places in the same file seems broken #135
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
+1 |
1 similar comment
+1 |
+1 |
Confirmed.
Exactly the same case. |
+1 |
+1 At the moment, you can bypass the problem by using custom name like this: .pipe(
$.inject( // app/**/*.js files
gulp.src(paths.jsFiles), {name: 'custom-name'})) and following HTML markup : <!-- custom-name:js -->
<!-- endinject --> Even if it is not "clean", it does the work. |
+1 And the code, to fix it, is : var gulp = require('gulp'),
inject = require('gulp-inject');
gulp.task('injector:js', function ()
{
return gulp.src('client/views/layout/layout.html')
.pipe(inject(gulp.src('.tmp/static/scripts/**/*.js'), {
ignorePath: '.tmp',
addRootSlash: false,
name: 'fix-inject'
}))
.pipe(gulp.dest('client/views/layout/'))
}); and following HTML markup: <!-- fix-inject:js -->
<!-- endinject --> |
After further investigations, the problem seems to be in 2.0.0 release and I guess it is in the commit 9861567 |
+1 |
1 similar comment
+1 |
+1 Dunno, using a custom name didn't worked for me. Tried using 1.5.0, didn't work. Even tried 1.3.0, didn't work. Any chance it's something down stream? Only 2 dependencies, "gulp-util" and "event-stream". Haven't really looked at the source to try and figure it out. |
I were afraid of this which was why I hesitated to implement an emptying feature as requested in #59 , #77 , #114 and #128. But had forgotten about it when I decided to implement it in the Using the I will hide the emptying feature behind an |
using starttag still seems to do the trick gulpfile.js: index.html |
I've been injecting different files from different streams into different injection blocks of the same file as described here: https://github.com/klei/gulp-inject#injecting-some-files-into-head-and-some-into-body.
However this doesn't work as expected anymore since I upgraded from
1.5.0
to2.2.0
, neither did I find a way to fix it. It appears that the injections from the first inject are overwritten by the latter.Here's a simplified example:
While with version
1.5.0
this produced the following output in theindex.html
:With version
2.2.0
the output is:Anyone else experiencing this issue? This keeps me from upgrading to the new version.
The text was updated successfully, but these errors were encountered: