Simple soy template webpack loader. It compiles a soy template without adding all the soy utils code.
npm i soy-template-loader --save-dev
...{
test: /\.soy$/,
loader: 'soy-template-loader',
query: {
debug: false,
yui: true
}
}...
- debug: Adds debug lines from the compiler.
- yui: Adds the YUI.add.
-
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.