parcel-plugin-handlebars-precompile-ts

1.0.0 • Public • Published

parcel-plugin-handlebars-precompile

Precompile handlebars templates into typescript allowing them to be imported as a regular typescript source. It is up to you how and when the template will be rendered.

Install

npm install --save-dev parcel-plugin-handlebars-precompile-ts

Usage

Import your handlebars template:

// index.ts
import templateFunction from "./template.hbs";
document.body.innerHTML = templateFunction();

Import index.ts from your index.html file:

<!DOCTYPE html>
<html>
  <!-- index.html -->
  ...
  <body>
    <script src="./index.ts"></script>
  </body>
  ...
</html>

Run the parcel bundler:

parcel build index.html

Credits

/parcel-plugin-handlebars-precompile-ts/

    Package Sidebar

    Install

    npm i parcel-plugin-handlebars-precompile-ts

    Weekly Downloads

    0

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    3.23 kB

    Total Files

    5

    Last publish

    Collaborators

    • alexpanich