Skip to content

bedeoverend/gulp-process-inline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gulp Process Inline

Process sections of HTML files (eg: scripts, styles) directly inline with Gulp.

Installation

Install gulp-process-inline with NPM

npm install --save-dev gulp-process-inline

Usage

gulp-process-inline takes a HTML selector, pulls its content out into a stream that you pipe to other Gulp plugins, then writes the transformed content back to HTML.

To use it just call .extract() with the HTML selector you want, then call .restore() when you want to write the contents back to HTML. Every instance of the selector in a given file will be iterated over and processed.

var gulp = require('gulp');
var processInline = require('gulp-process-inline');

gulp.task('scripts', function() {
  return gulp.src('./src/index.html')
    .pipe(processInline().extract('script'))
      // Pipe other gulp plugins here
      // eg: .pipe(uglify())
    .pipe(processInline().restore())
    .pipe(gulp.dest('./dist'));
});

License

MIT © Bede Overend

About

Gulp plugin to extract and restore partials from HTML files

Resources

Stars

Watchers

Forks

Packages

No packages published