rollup-plugin-phtml
rollup-plugin-phtml lets you use pHTML with Rollup.
Install
Add rollup-plugin-phtml to your project:
npm install rollup-plugin-phtml --save-dev
Usage
Use rollup-plugin-phtml in your Rollup configuration:
// rollup.config.js; plugins:
Then you can use HTML files:
;
Options
plugins
The plugins
property determines which pHTML plugins are applied.
processOptions
The processOptions
property determines which pHTML custom settings are
applied.
inject
The inject
option allows HTML imports to be injected into the document. By
default, this features is disabled.
When true
, HTML is injected into <body>
if it is available.
// Inject to `<body>`
The HTML string is still available as the default export.
// Inject to `<body>` and also available as `pageHTML`
When a String, HTML is injected into the matching selector, if it is available.
// Inject to `<head>`