Skip to content

process html files through juice to inline CSS

Notifications You must be signed in to change notification settings

zebapy/gulp-juice

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-juice

build status

Stream html files through juice to inline CSS.

Examples

var juice = require('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:

var juice = require('gulp-juice'),
  jade = require('gulp-jade');

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

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

License

MIT

About

process html files through juice to inline CSS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 56.4%
  • JavaScript 43.6%