Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

edp-provider-smarty4js

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

edp-provider-smarty4js

edp 的 smarty4js 支持模块,为 webserver 和 build 命令提供了预定配置

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

edp-provider-smarty4js

NPM version License

edpsmarty4js 支持模块,为 webserverbuild 命令提供了预定配置

安装

npm install edp-provider-smarty4js --save-dev

配置

创建 edp-smarty4js-config.js 配置

var eps = require('edp-provider-smarty4js');

// 默认配置
eps.config({
    'left_delimiter': '{%',
    'right_delimiter': '%}'
});

module.exports = exports = eps;

edp-webserver-config.jsedp-build-config.js 顶部引入:

var eps = require('./edp-smarty4js-config.js');

edp-webserver-config.js 对应部分添加:

var smarty4jsHandler = eps.webserver;

exports.getLocations = function () {
    return [
        // handlers
        {
            location: /\.tpl\.js($|\?)/,
            handler: [
                smarty4jsHandler({
                    extname: '.html',
                    complieOption: eps.config()
                })
            ]
        }    
    ];
};


edp-build-config.js 对应部分添加:

var Smarty4jsCompiler = eps.build;

new Smarty4jsCompiler({
    files: [
        'src/**/*.tpl.html'
    ],
    complieOption: eps.config()
});

搞定!

DEMO

git clone https://github.com/ecomfe/edp-provider-smarty4js.git
cd edp-provider-smarty4js
npm i 
cd demo
edp build
edp webserver start

see: http://127.0.0.1:8868 or http://127.0.0.1:8868/output

相关

License

MIT © Baidu Inc.

FAQs

Package last updated on 19 Feb 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc