Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Gulp pHTML pHTML

NPM Version Build Status Support Chat

Gulp pHTML lets you use pHTML with Gulp.

Install

Add Gulp pHTML to your project:

npm install gulp-phtml --save-dev

Usage

Use Gulp pHTML in your Gulpfile:

const gulp = require('gulp')
const gulpPhtml = require('gulp-phtml')

gulp.task('html',
  () => gulp.src('./src/*.html').pipe(
    gulpPhtml({
      /* pHTML Plugins */
      plugins: [], // Array | Plugin | Function

      /* pHTML Plugins */
      processOptions: {} // Object
    })
  ).pipe(
    gulp.dest('dist')
  )
)

Options

plugins

The plugins property determines which pHTML plugins are applied.

gulpPhtml({
  plugins: require('@phtml/image-alt')
})
gulpPhtml({
  plugins: [
    require('@phtml/image-alt'),
    require('@phtml/image-size')({ intrinsicsize: 'intrinsic' })
  ]
})

processOptions

The processOptions property determines which pHTML custom settings are applied.

gulpPhtml({
  processOptions: {
    voidElements: ['path', 'source', 'use']
  }
})

About

Use pHTML with Gulp

Resources

Releases

No releases published

Packages

No packages published