0

I used ejs and heredoc to compile xml files :

const ejs = require('ejs');
const heredoc = require('heredoc');

var tpl = heredoc(function(){/*
  <xml>
  <ToUserName><![CDATA[<%= toUserName %>]]></ToUserName>
  <FromUserName><![CDATA[<%= fromUserName %>]]></FromUserName>
  ....
  </xml>
*/});

however,after using jslint and compiling by babel,it becomes like this :

var ejs=require("ejs"),heredoc=require("heredoc"),
tpl=heredoc(function(){});

the content in heredoc was missing. It seems that the compiler regards the code inside as comments.

Does anyone know how to solve this ?

Seven
  • 549
  • 1
  • 4
  • 10

0 Answers0