can opt.relative more specify?
Rockergmail opened this issue · 0 comments
Rockergmail commented
My Expectation:
-src
-tpl
-tplA
-index.html
-index.css
-tplB
-index.html
-index.css
// Example - tplA
// index.html
<!-- inject:style:css -->
<!-- endinject -->
<p>Content Here</p>
// index.css
.test{color:red}
After Gulp:
-dest
-tpl
-tplA
-index.html(injected index.css)
-tplB
-index.html(injected index.css)
// Example - tplA
// index.html
.test{color:red} /*injected tplA index.Css only*/
<p>Content Here</p>
// The same as tplB、tplC、tplD...
But ...
gulp.task('inject', function(){
gulp.src('./src/**/*.html')
.pipe(inject(gulp.src('./src/**/*.css'), {
relative: true,
starttag: '<!-- inject:style:{{ext}} -->',
transform: function(filePath, file) {
return "<style>\n" + file.contents.toString('utf8') + "\n</style>";
}
}))
.pipe(gulp.dest('./dest'))
});
Although the relative option is fired, but it will include all tpls‘ css files, but what i want is just tplA's. What can i do ?
Respect.