soy-template-loader
v0.0.4
Published
Webpack loader for soy templates
Downloads
8
Readme
Soy Template loader
Simple soy template webpack loader. It compiles a soy template without adding all the soy utils code.
Install
npm i soy-template-loader --save-dev
Example
...{
test: /\.soy$/,
loader: 'soy-template-loader',
query: {
debug: false,
yui: true
}
}...
Options
- debug: Adds debug lines from the compiler.
- yui: Adds the YUI.add.
Use
Template
{namespace NAMESPACE} /** * Template description * @param name arguments */ {template .hello} Hello {$name}! {/template}
Javascript
import * as template from './template.soy'; var html = template.hello({ name: 'name' });
Note: namespace is mandatory.