Transforms hbs files to template functions
Works with parcel 2
npm install --save-dev parcel-transformer-hbs
yarn add -D parcel-transformer-hbs
In your .parcelrc
add:
"transformers": {
"*.hbs": ["parcel-transformer-hbs"]
}
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>
- Handlebars - A templates on steroids.
- Parcel - Zero configuration bundler.