title: Grunt task to modify javascript file
body: <p>I have following node.js javascript file.</p>
  
  <pre><code>module.exports = function(){
      ...
      var config1 = "";
      var config2 = "";
      var config3 = "";
      ...
  }
  </code></pre>
  
  <p>Suppose I have following grunt task.</p>
  
  <pre><code>grunt.registerTask('task1', ['...',copy]);
  grunt.registerTask('task2', ['...',copy]);
  grunt.registerTask('task3', ['...',copy]);
  </code></pre>
  
  <p>Depending on which task I am running, config1, config2, config3 varible value should change.</p>
  
  <p>For example:</p>
  
  <pre><code>grunt task1
  </code></pre>
  
  <p>should produce</p>
  
  <pre><code>module.exports = function(){
      ...
      var config1 = "A";
      var config2 = "B";
      var config3 = "C";
      ...
  }
  </code></pre>
  
  <p>while 
      grunt task2</p>
  
  <p>should produce</p>
  
  <pre><code>module.exports = function(){
      ...
      var config1 = "X";
      var config2 = "Y";
      var config3 = "Z";
      ...
  }
  </code></pre>
  
  <p>Is there any grunt plugin which can do this or similar?</p>