0

I am using grunt usemin plugin to minify my javascripts on a JSP page.

I would like to extend grunt features to achieve code similar to the one below; basically add some jsp scriptlet feature code using processhtml or template plugins so that there will be more control on debugging while deploying code to production.

Is this possible?

<c:choose>
<c:when test="${true eq param.jsdebug}">                                       
    <script type="text/javascript" src="js/plugins/ratings/star-rating.js"></script>
</c:when>
<c:when test="${true eq param.jscombined}">
    <script type="text/javascript" src="target/minify/assets/js/skills/skills.combined.js"></script>            
</c:when>
<c:otherwise>
    <script type="text/javascript" src="target/minify/assets/js/skills/skills.min.js"></script>    
</c:otherwise>

Shinu
  • 73
  • 2
  • 7
  • `usemin` is applicable at compile/build time while your `${param.jsdebug}` is applicable only at runtime. Means, I don't think this is possible. You might want to look at where your `${param}` comes from and see if it is static for a build, then a different approach might be possible. Won't be easy though still. – anoopelias Feb 05 '15 at 12:29
  • @anoopelias What I am trying to do is to inject the above piece of code at build time only. Here is what I am trying to do. My input to usemin or my jsp code will have the usemin snippet ` ` And output I expect after gruntify from usemin + processhtml or template is the one I pasted in original question The above output mentioned in my question. – Shinu Feb 06 '15 at 04:02
  • Understood. So, this is clearly possible if you do, ` ` What is your question then? – anoopelias Feb 07 '15 at 04:50
  • @anoopelias As I mentioned in my question I am looking for this scriptlet code to be injected part of build only using grunt plugins – Shinu Feb 07 '15 at 11:46

0 Answers0