atool-html2js

angular html2js 将文件夹下的html 文件合并为一个angular template js

Usage no npm install needed!

<script type="module">
  import atoolHtml2js from 'https://cdn.skypack.dev/atool-html2js';
</script>

README

atool-html2js

angular template 将多个html 文件转为一个angular模块

使用

  var content = html2js({
    cwd: path.join(baseSrc,'views'),
    rename: function(url){
      return url.replace(path.join(baseSrc,'views'),'views');
    },htmlmin: {
      collapseWhitespace: true
    }});
  //scripts 目录存在不检查
  fs.writeFileSync(path.join(baseSrc,'scripts/project.tpl.js'),content);

详细api参考代码

bug 反馈 zhoujianlin8@gmail.com