parcel-transformer-hbs
v1.0.4
Published
transforms hbs files to template functions
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-hbsIn 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.
