Using `?` tags in `addPrefix` seems to drop all assets
See original GitHub issueHi,
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
Issue Analytics
- State:
- Created 8 years ago
- Comments:7
Top Results From Across the Web
Add prefix to routes in React Router v4 - Stack Overflow
Currently I am using this approach but it doesn't seem to working. When I go to http:\\localhost:3000\v1\login it shows the NotFound component.
Read more >GNU make
To use this makefile to delete the executable file and all the object files from the directory, type: make clean. In the example...
Read more >Work with digital assets in Optimizely PIM
Hover over a tag and click the X to remove it. Add Prefix to these assets. View the File Types Detected. This is...
Read more >Tagging all assets in a sub directory
I'm building a project with a lot of photo assets organized into sub directories of the main photos asset source. I'm trying to...
Read more >Task | ClearML
Delete the task as well as its output models and artifacts. Models and artifacts are deleted from their storage locations, each using its...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If it helps anyone else, this is what I’m currently using for adding the prefix for the Wordpress template directory for css, js & html files. Thanks for the transform workaround @humancatfood! +1
@flovan
This would be a great fix, the
addPrefix
option is just perfect for php inserts!My workaround for now is the
transform
-option. In your case that would be