1.0.4 • Published 7 years ago

temple-webpack-loader v1.0.4

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

temple-loader

A temple template loader for webpack.

General Usage

webpack configuration

{
  ...
  module: {
    loaders: [
      ...
      { test: /\.temple/, loader: "temple-loader" }
    ]
  }
}

Your JS making use of the templates

<div>
  <forall name="files" key="files">
    <div>{{name}}
  </forall>
<div>
var temple_utils = require('temple-wat');
var template = require("./files_list.temple");
var pool = temple_utils.pool(template);
var data = {
  files: [{name: 'foo'}]
};
var temple_data = pool.get('files_list'); // => returns file.temple content as a temple obj
document.body.appendChild(temple_data[0]);
temple_data[1].update(data);

See webpack documentation for more information regarding loaders.

1.0.4

7 years ago

1.0.3

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago