Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.22 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.22 KB

premailer-gulp-juice

build status npm downloads

Stream html files through juice to inline CSS.

Examples

npm install premailer-gulp-juice --save-dev 
const juice = require('premailer-gulp-juice');

gulp.task('bootloader', function(){
  gulp.src('./.build/bootloader.html')
    .pipe(juice({}))
    .pipe(gulp.dest('./.build/bootloader.inline.html'));
});

gulp.task('deploy', ['build', 'manifest', 'bootloader', 'publishtoS3']);

Protip when using with a template renderer: need to pipe to dest first as you probably want juice resolving css relative to our actual build output:

const juice = require('premailer-gulp-juice'),
  pug = require('gulp-pug');

gulp.task('bootloader', function(){
  gulp.src('./app/templates/bootloader.pug')
    .pipe(pug({pretty: true}))
    .pipe(gulp.dest('./.build'))
    .pipe(juice())
    .pipe(gulp.dest('./.build'));
});

gulp.task('deploy', ['build', 'manifest', 'bootloader', 'publishtoS3']);

License

MIT