M
M
magic_ball2013-12-28 18:09:54
JavaScript
magic_ball, 2013-12-28 18:09:54

How to replace text in templates in grunt?

Good afternoon.
I also use gruntit grunt-preprocessto convert static html.
Tell me what plugins can I use to replace part of the text during assembly?
grunt-preprocessand directives <!-- @if NODE_ENV='prod' -->
do not fit - because I plan to replace it with a text from the database (once a day) and conditional constructions will be useless.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2013-12-28
@magic_ball

grunt has its own templating system, with conditionals and loops.
gruntjs.com/api/grunt.template
you can use grunt-contrib-copy and add a handler for each file that will compile the template.

Y
Yuri Shikanov, 2013-12-28
@dizballanze

https://npmjs.org/package/grunt-text-replace

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question