0.2.0 • Published 8 years ago
gulp-process-inline v0.2.0
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-inlineUsage
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