A plugin that allows you to import stache templates with stealjs.
JavaScript HTML
Latest commit cab2ec9 Jan 10, 2017 @matthewp matthewp Update dist for release

readme.md

Build Status

steal-stache

Load can-stache templates with StealJS

Usage

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";

API

steal-stache Object

A StealJS extension that allows stache templates as dependencies.

STACHE_MODULE_NAME!steal-stache

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
  1. STACHE_MODULE_NAME {moduleName}: The module name of a stache template. This will typically be something like templates/main.stache.

  • returns {can-stache.renderer}: A renderer function that will render the template into a document fragment.

Contributing

Making a Build

To make a build of the distributables into dist/ in the cloned repository run

npm install
node build

Running the tests

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