jSmart loader lets you use jSmart(Smarty template javascript engine) and Webpack together, including auto-loading partials.
npm install jsmart-loader --save-dev
#### webpack 2.x to webpack 5.x
```javascript
module: {
rules: [ {
test: /\.tpl|\.smarty$/,
loader: 'jsmart-loader'
} ]
}
module: {
loaders: [ {
test: /\.tpl|\.smarty$/,
loader: 'jsmart'
} ]
}
var template = require('./template.smarty');
var html = template({ name: 'world' });
If you want to set custom delimiters then you can pass on delimiters one (left or right) or both using options. You can also pass on auto delimiters detection on or off using options.
module: {
rules: [ {
test: /template\.smarty$/,
loader: 'jsmart-loader',
options: {
leftDelim: '{{',
rightDelim: '}}',
autoLiteral: false
},
} ]
}