parcel-transformer-hbs
v1.0.4
Published
transforms hbs files to template functions
Downloads
4,173
Maintainers
Readme
parcel-transformer-hbs
Transforms hbs files to template functions
Works with parcel 2
Install
npm install --save-dev parcel-transformer-hbs
yarn add -D parcel-transformer-hbs
In your .parcelrc
add:
"transformers": {
"*.hbs": ["parcel-transformer-hbs"]
}
Usage
Import your handlebars template:
// index.js
import templateFunction from './template.hbs';
document.body.innerHTML = templateFunction();
Import index.js
from your index.html
file:
<!DOCTYPE html>
<html>
<body>
<script src="./index.js"></script>
</body>
</html>
Credits
- Handlebars - A templates on steroids.
- Parcel - Zero configuration bundler.