jsmart-loader

2.0.0 • Public • Published

jSmart loader for webpack

jSmart loader lets you use jSmart(Smarty template javascript engine) and Webpack together, including auto-loading partials.

Build Status npm version David David npm

Install

npm install jsmart-loader --save-dev

Usage

#### webpack 2.x to webpack 5.x
```javascript
module: {
    rules: [ {
        test: /\.tpl|\.smarty$/,
        loader: 'jsmart-loader'
    } ]
}

webpack 1.x

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
    },
  } ]
}

Documentation: Using loaders.

/jsmart-loader/

    Package Sidebar

    Install

    npm i jsmart-loader

    Weekly Downloads

    8

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    11.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • umakant