Liquid template loader module for webpack
npm install liquid-template-loaderLiquid template engine (see http://github.com/shopify/liquid) for webpack loader.
This loader was ported from liquid-loader (see https://github.com/azeeson/liquid-loader).
To begin, you'll need to install liquid-template-loader.
```
npm install --save-dev liquid-template-loader
index.html
` Hi {{ name }}html`
webapck.config.js
`js
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
module: {
rules: [
{
test: /\.html$/,
use: [
{
loader: 'html-loader'
},
{
loader: 'liquid-template-loader',
options: {
data: {
'name': 'satoshi'
},
}
}
]
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: __dirname + 'index.html',
})
]
}
`
`js
options: {
...
filters: {
myFilter: input => {
return String(input).toUpperCase()
}
}
}
`
`js``
options: {
...
tags: {
myTag: class MyTag extends Liquid.Tag {
render () {
return 'Hello World';
}
}
}
}
For detail implementaion, you can see https://github.com/docs/liquid/tree/master/lib/liquid/tags.