parcel-plugin-phtml
v1.0.1
Published
Parcel plugin for load html file as string that use .phtml extension
Downloads
1
Maintainers
Readme
# parcel-plugin-phtml
Parcel plugin for load html file as string that use .phtml extension
Installation
npm install --save-dev parcel-plugin-phtml
Example
my-component.phtml
<my-component> lorem ipsum</my-component>
index.js
import html from './my-component.phtml'; console.log(html);
index.html
<!DOCTYPE html> <html> <head> <title>parcel-plugin-phtml demo</title> </head> <body> <h1>parcel-plugin-phtml demo</h1> <p>see your browser's console</p> <script type="text/javascript" src="index.js"></script> </body> </html>
.posthtmlrc
{ "plugins": { "posthtml-custom-elements": {} } }
parcel index.html
output
<div class="my-component"> test post-html </div>
good luck