gruntjs - Strategy to use grunt-processhtml in development -
how should 1 use grunt-processhtml
in development environment?
for example, in index.html
, i'll load partials angular when built:
<!-- build:include:dist views/template-main.html --> <script type="text/ng-template" id="views/template-main.html"> --> </script> <!-- /build -->
but want happen in built environment, not environment development environment (app/
) that's served grunt serve
?
or, more common example,
<!-- @if node_env='production' --> <script src=" production script "></script> <!-- @endif --> <!-- @if node_env='dev' --> <script src=" sandbox script "></script> <!-- @endif -->
how sandbox script served in development environment (app/
) served grunt serve
should performing grunt build
every time , instead of grunt
/node
serving contents of app/
, somehow change serve development build (i.e. dist/
)
or should writing these grint-processhtml
directives (or pre-processor) in file, e.g. pre.index.html
, have built index.html
?
otherwise, if grunt-processhtml
run, removes directives, if it's not, browser ignores grunt-processhtml
directives , loads both scripts.
(this angularjs project scaffolded yeoman, general grunt-processhtml question)
i think misunderstood how use grunt.
i suspect best add different build targets, e.g. dev
, production
, etc, , not use app/
, dist
.
this involves setting different built targets, setting different targets served.
a explanation: have grunt generate index.html different setups
Comments
Post a Comment