Skip to content

nesk/gulp-htmlprocessor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-htmlprocessor

Process html files at build time to modify them depending on the release environment

This project is a Gulp implementation of node-htmlprocessor, which is the standalone library of the grunt-processhtml plugin.

Status

Currently, as of v0.3.3 every features of grunt-processhtml are supported.

Differences

The only difference between the Grunt plugin and this Gulp plugin is the environment option, it must be set manually due to the lack of target management in Gulp.

Usage

Be sure to have the latest version of Gulp:

npm install -g gulp

Install the plugin with this command:

npm install --save-dev gulp-htmlprocessor

The options and the HTML syntax are listed in the original documentation.

Now, you can process your HTML in your gulpfile.js:

var gulp = require('gulp'),
    htmlprocessor = require('gulp-htmlprocessor');

var options = {
    // Pass your options here
};

gulp.task('default', function() {
    return gulp.src('src/*.html')
        .pipe(htmlprocessor(options))
        .pipe(gulp.dest('dist'));
});

Test

To run the tests, just use the following command:

npm test

About

Process html files at build time to modify them depending on the release environment

Resources

License

Stars

Watchers

Forks

Packages

No packages published