tpl-2-js

2.0.2 • Public • Published

tpl-2-js

A tool which can compile tpl to tpl.js & replace require('xxx.tpl') to require('xxx.tpl.js')

Install

npm install tpl-2-js -g

Usage

tpl-2-js -p <your file dir>

tpl-2-js -p dist/

Example

+dist
 -a.js
 -a.tpl


// a.js
define(function(require, exports, module){
    var view = View.extend({
        template: require('a.tpl')
    });
});
// a.tpl
<h1>I am b</h1>

tpl-2-js -p dist

// a.js
define(function(require, exports, module){
    var view = View.extend({
        template: require('compiled/a.tpl.js')
    });
});

// compiled/a.tpl.js
define(function(require, exports, module){
    module.exports = '<h1>I am b</h1>';
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.2
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.2
    4
  • 1.0.2
    0
  • 1.0.1
    2
  • 1.0.0
    0

Package Sidebar

Install

npm i tpl-2-js

Weekly Downloads

6

Version

2.0.2

License

ISC

Last publish

Collaborators

  • freestyle21