jamesknelson / gulp-rev-replace

Rewrite occurences of filenames which have been renamed by gulp-rev
MIT License
388 stars 62 forks source link

working with html.twig (php templates) file #65

Open AakashGfude opened 8 years ago

AakashGfude commented 8 years ago

Hi,

My revreplace task is ::-

gulp.task("revreplace", ["revision"], function(){ var manifest = gulp.src("web/public/assets/javascript-build/rev-manifest.json");

return gulp.src("src/Webmuch/HomeBundle/Resources/views/Index/index.html.twig") .pipe(debug({title: 'unicorn:'})) .pipe(revReplace({manifest: manifest,replaceInExtensions: ['.html.twig']})) .pipe(gulp.dest("web/public/assets/javascript-build")); });

when i work with .html files, it replaces the script tags correctly, but not in .html.twig files . How to achieve that ?

BrunoViera commented 8 years ago

Hi! I use this configuration and works for me. Let me know if I can help you

gulp.task("revreplace", ["revision"], function() {
    var manifest = gulp.src("web/public/assets/javascript-build/rev-manifest.json");
    return gulp.src("path/to/my/file/Index/index.html.twig")
        .pipe(debug({title: 'unicorn:'}))
        .pipe(revReplace({manifest: manifest, replaceInExtensions: '.twig'}))
        .pipe(gulp.dest("web/public/assets/javascript-build/"));
});