Search code examples
javascriptgruntjsproduction

Grunt - modify JS file while building


I am using Grunt as my task manager and would like to change JS file/s while building bundle for production. My main goal is to change config files and data inside them because data is different. What is the best possible solution for this?


Solution

  • You could use a replace module of grunt: grunt-text-replace or grunt-replace

    And I recommend that you insert a key on your file to replace via grunt in all environments.