How can I use Gulp to add a line of text to a file
I've been trying to figure out how to add a line of text to any type of file using Gulp. For instance add: @import 'plugins' to my main.sass file. Or add a CDN to an index.html file. I did try: gulp.task('inject-plugins', function(){ gulp.src('src/css/main.sass') .pipe(inject.after('// Add Imports', '\n@import \'plugins\'\n')); }); with no joy. Any idea how I could achieve this please? Depends on what you want to do. If you just want to add text to the beginning or end of a file gulp-header and gulp-footer are your friends: var header = require('gulp-header'); var footer = require('gulp-footer