stc-js-tpl-replace

1.0.2 • Public • Published

stc-js-tpl-replace

Replace references to templates by their contents in js files

Usage:

    var jsTplReplace = require('stc-js-tpl-replace');

    stc.workflow({
        jsTplReplace: {plugin: jsTplReplace}
    });

Codes above will transfer source js and source template files into output files below:

source js:

    var str = $('#myTplId').html();

source template, whose type is text/html or text/template by default:

    <script type="text/html" id="myTplId">
        <div>
            something…
        </div>
    </script>

output:

js:

    var str = "\n    <div>\n        something…\n    </div>\n";

tpl:

    <nothing here!>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    2
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i stc-js-tpl-replace

Weekly Downloads

4

Version

1.0.2

License

none

Last publish

Collaborators

  • huangxiaolu