Grunt-tagged-replace

Replace pieces of your source using comment tags to identify the location.

Tagged Replace Grunt Plugin

A grunt plugin that replaces pieces of your source using comment tags to identify the location.

What it does

It takes code like:

let server = /*server*/ DEVSERVER /*/server*/

And allows you to configure a target like:

grunt.initConfig({
  taggedReplace: {
    dev: {
      tags: [
        {
          server: 'DEVSERVER'
        }
      ]
    },
    prod: {
    tags: [
      {
        server: 'PRODSERVER'
      }
    ]
    }
  }
})

grunt.registerTask('buildprod', ['taggedReplace:prod'])
grunt.registerTask('builddev', ['taggedReplace:dev'])

Then just run: grunt buildprod