I'm new to grunt. I'm trying to remove a snippet of code from my index.html pagae when using grunt to build to my prod environment. Here's my code:
<!-- build:remove -->
<base href="/"></base>
<!-- /build -->
<title>Some App</title>
<!-- build:css css/styles.min.css -->
<link href="/app/css/header.css" rel="stylesheet" />
<link href="/app/css/content.css" rel="stylesheet" />
<!-- /build -->
<!-- build:js js/scripts.head.min.js -->
<script src="/app/lib/myApp.js"></script>
<script src="/app/lib/someApp.js"></script>
<!-- /build -->
And here's my code for gruntfile.coffee:
grunt.task.run("processhtml:build:#{targetEnv}")
Here's how I have configured processhtml:
_processHtml =
options: strip: true
build: files: 'www/index.html': ['app/index.html']
If I add prod target to build:remove statement in index.html page, then the HTML code is not removed. However, if I leave the target ('prod') off then the HTML code is removed. This seems backwards to me.
So, this works when I type in grunt build:prod - the 'base' tag is removed:
<!-- build:remove -->
<base href="/"></base>
<!-- /build -->
this doesn't work when I type in grunt build:prod - the 'base' tag remains:
<!-- build:remove:prod -->
<base href="/"></base>
<!-- /build -->
Any ideas n how I can fix this please - either my code or my understanding? Thank you.