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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

pHTML Loader pHTML

NPM Version Build Status Support Chat

pHTML Loader lets you use pHTML with Webpack.

Install

Add pHTML Loader to your project:

npm install phtml-loader --save-dev

Usage

Use pHTML Loader in your Webpack configuration:

module.exports = {
  module: {
    rules: [
      {
        test: /\.html$/,
        use: [
          { loader: 'phtml-loader', {
            options: {
              /* Plugins */
              plugins: [], // Array | Plugin | Function

              /* Process Options */
              processOptions: {} // Object
            }
          } }
        ]
      }
    ]
  }
}

Options

plugins

The plugins property determines which pHTML plugins are applied.

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

processOptions

The processOptions property determines which pHTML custom settings are applied.

{ loader: 'phtml-loader', {
  options: {
    processOptions: {
      voidElements: ['path', 'source', 'use']
    }
  }
} }

About

Use pHTML with Webpack

Resources

Releases

No releases published

Packages

No packages published