-
Notifications
You must be signed in to change notification settings - Fork 37
Removing parts
Maxime LUCE edited this page Mar 8, 2015
·
3 revisions
When using grunt-html-build, you can generate a HTML page which remove some dev parts.
<html>
<head>
...
</head>
<body>
<div> ... </div>
<p> ... </p>
<!-- build:remove -->
<p class="debug-only"></p>
<input type="text" id="test" />
<!-- /build -->
<!-- build:remove dev,test -->
<p class="prod-only"></p>
<!-- /build -->
</body>
</html>
grunt.initConfig({
htmlbuild: {
dist: {
src: 'index.html',
dest: 'dist/'
}
}
});
<html>
<head>
...
</head>
<body>
<div> ... </div>
<p> ... </p>
<p class="prod-only"></p>
</body>
</html>
Note that .prod-only is part is kept because we configured remove task to remove this part only during dev or test target.