Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

jsmart-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsmart-loader

Use jSmart (PHP Smarty port in JS) in Webpack.

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

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.

Keywords

jsmart

FAQs

Package last updated on 27 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts