How should one use grunt-processhtml
in the development environment?
For example, in index.html
, I'll do something like load partials for angular when this is built:
<!-- build:include:dist views/template-main.html -->
<script type="text/ng-template" id="views/template-main.html"> -->
</script>
<!-- /build -->
But I only want that to happen in the built environment, not the environment the development environment (app/
) that's served by grunt serve
?
Or, for a more common example,
<!-- @if NODE_ENV='production' -->
<script src=" production script "></script>
<!-- @endif -->
<!-- @if NODE_ENV='dev' -->
<script src=" sandbox script "></script>
<!-- @endif -->
How do I get only the sandbox script to be served in the development environment (app/
) served by grunt serve
Should I be performing a grunt build
every time and instead of grunt
/node
serving the contents of app/
, somehow change it to serve a development build (i.e. dist/
)
Or should I be writing these grint-processhtml
directives (or any pre-processor) in another file, e.g. pre.index.html
and have it built to index.html
?
Otherwise, if grunt-processhtml
is run, it removes the directives, if it's not, the browser obviously ignores the grunt-processhtml
directives and loads both scripts.
(This is for a AngularJS project scaffolded by Yeoman, but is a general grunt-processhtml question)