I have to exclude non-javascript character sets like <%
,<%-
, <%=
and %>
character sets when I uglifying / minifying javascript codes. (Just these characters)
For example the below codes should be transform to its below codes after uglified/minified process;
raw codes;
<% if (!user.admin) { %>
var a=1;
console.log(a);
<% } %>
minified codes;
<% if (!user.admin) { %>var a=1;console.log(a);<% } %>
Use https://github.com/yeoman/grunt-usemin
Take a look at specifically https://github.com/yeoman/grunt-usemin#blockreplacements
Define your own block and replace it with whatever suits you.