Load can-stache templates with StealJS
This package will configure Steal so that you can import templates. Start by installing with NPM.
npm install steal-stache --save
And then assuming you are using NPM with Steal like:
<script src="node_modules/steal/steal.js"></script>
All you have to do is import the template:
import template from "./main.stache";
A StealJS extension that allows stache templates as dependencies.
Import a [can-stache stache] module in your code and use it to render.
var template = require("./main.stache");
var Map = require("can-map");
var map = new Map();
var frag = template(map);
// frag is a live-bound DocumentFragment
- STACHE_MODULE_NAME
{moduleName}
: The module name of a stache template. This will typically be something liketemplates/main.stache
.
- returns
{can-stache.renderer}
: A renderer function that will render the template into a document fragment.
To make a build of the distributables into dist/
in the cloned repository run
npm install
node build
Tests can run in the browser by opening a webserver and visiting the test.html
page.
Automated tests that run the tests from the command line in Firefox can be run with
npm test