Open raduchiriac opened 8 years ago
Same issue, i can't figure where put newer because before the inject pipe (passing the same src glob) it doesn't work, this is my task:
gulp.task('postcss', () => {
const postCSSPlugins = [
discardComments(),
cssnext({
browsers: ['last 2 version']
}),
precss(),
cssnano({
autoprefixer: false
}),
reporter({
clearReportedMessages: true
})
];
// Parse each .css file and save the content inside parsedStyle
var parsedStyle = gulp.src(`${paths.components}/**/*.css`, {base: "./"}).pipe(postcss( postCSSPlugins ));
// Inject the css content inside his relative style-module.html
gulp.src(`${paths.components}/**/style-module.html`, {base: './'})
.pipe(inject(parsedStyle, {
starttag: '/* inject:{{path}} */',
endtag: '/* endinject */',
relative: true,
transform: (filePath, file) => {
// return file contents as string
return file.contents.toString('utf8')
}
}))
.pipe(gulp.dest('.'));
});
Although I don't think it's an actual issue perse, but I can't seem to attach
gulp-newer
beforegulp-inject
. Myindex.html
file gets rewritten every time I change my files and it's annoying.This is what I tried:
TypeError: index.html is not a function