[Schematics] 2. EJS

Schematices using EJS as template language. 

template:

<%# This will not appear in the generated output %>
// This will appear in the generated output

const unescaped = '<%= "<" %>'; // <
const escaped = '<%- "<"%>'; // &lt;

<% if(true) { %>const conditionalTest = true; <% } %>
<% if(false) { %>const conditionalTest = false; <% } %>

 

output file:

// This will appear in the generated output

const unescaped = '<'; // <
const escaped = '&lt;'; // &lt;

const conditionalTest = true; 

 

猜你喜欢

转载自www.cnblogs.com/Answer1215/p/11985559.html