Skip to content

phtmlorg/gulp-phtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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']
  }
})

Releases

No releases published

Packages

No packages published