gulp-phtml
v2.1.0
Published
Use pHTML with Gulp
Downloads
6
Maintainers
Readme
Gulp pHTML
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']
}
})