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!>

Readme

Keywords

none

Package Sidebar

Install

npm i stc-js-tpl-replace

Weekly Downloads

3

Version

1.0.2

License

none

Last publish

Collaborators

  • huangxiaolu