Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/canjs/can-stache-loader
CanJS Stache loader for webpack
https://github.com/canjs/can-stache-loader
can canjs handlebars loader mustache stache webpack webpack-loader webpack2
Last synced: about 1 month ago
JSON representation
CanJS Stache loader for webpack
- Host: GitHub
- URL: https://github.com/canjs/can-stache-loader
- Owner: canjs
- License: mit
- Created: 2017-03-30T18:11:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-06-11T17:43:20.000Z (over 4 years ago)
- Last Synced: 2024-09-27T22:20:53.093Z (about 2 months ago)
- Topics: can, canjs, handlebars, loader, mustache, stache, webpack, webpack-loader, webpack2
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/can-stache-loader
- Size: 1.72 MB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![version](https://img.shields.io/npm/v/can-stache-loader.svg)](https://www.npmjs.com/package/can-stache-loader)
[![dependencies](https://img.shields.io/david/macku/can-stache-loader.svg)](https://david-dm.org/macku/can-stache-loader)
[![dev dependencies](https://img.shields.io/david/dev/macku/can-stache-loader.svg)](https://david-dm.org/macku/can-stache-loader?type=dev)# CanJS Stache template loader for webpack
Compiles [CanJS Stache](https://github.com/canjs/can-stache) templates with [can-view-parser](https://github.com/canjs/can-view-parser) and allows to load them with [webpack](https://webpack.github.io/)
## How to install
### NPM and Yarn
You can install the library using [**NPM**](https://www.npmjs.com):
```bash
npm install can-stache-loader --save-dev
```or by [**Yarn**](https://yarnpkg.com/):
```bash
yarn add can-stache-loader
```## How to use it
### Configure webpack 2+
**webpack.config.js**
```js
{
module: {
rules: [
{
test: /\.stache$/,
use: {
loader: 'can-stache-loader'
}
}
]
}
}
```### Import stache templates in your [CanJS](https://canjs.com/) project
```js
import tpl from './template.stache';const html = tpl({
foo: 'bar'
});
```## CanJS Compatibility
This library works fine with [CanJS](https://canjs.com/) version **4.0.0+** and [webpack](https://webpack.github.io/) **2.0.0+**.
## License
[MIT](https://opensource.org/licenses/MIT)