dciccale / grunt-processhtml

Process html files at build time to modify them depending on the release environment
MIT License
407 stars 30 forks source link

Is there any way to use variables in comments build? #88

Closed adrigm closed 8 years ago

adrigm commented 8 years ago

Example:

<!-- build:css:dist <%= assets %>/css/plugins.min.css -->
    <link rel="stylesheet" href="<%= assets %>/css/plugins.css">
<!-- /build -->

Result:

<link rel="stylesheet" href="undefined">
adrigm commented 8 years ago

Solved.

Spaces must be removed.

<!-- build:css:dist <%=assets%>/css/plugins.min.css -->
    <link rel="stylesheet" href="<%= assets %>/css/plugins.css">
<!-- /build -->
davidzoli commented 6 years ago

Is this works only with css type? I try to use this with some variables from the <% %> tags with include type. Is this possible somehow?

This works as it should.

<!-- build:include modules/_footer.html --><!-- /build -->

This doesn't. Nothing included.

<% var incFile = '_footer' %>
<!-- build:include modules/<%=incFile%>.html --><!-- /build -->