Sarath
Sarath

Reputation: 9146

How to combine js file in a custom way with grunt.js?

I want a token based search and replace functionality for grunt.

like

  single:{
                input:"./input.js",
                output:"./output.js",
                tokens:[{
                    token:"$1",
                    file:"./file.js"
                },{
                    token:"%2",
                    string:"replacement string"
                },{
                    token:"!3",
                    file:"./file.txt"
                }]
            },

from .. grunt-combine https://github.com/mcgaryes/grunt-combine/

this is not supported in grunt .4 version . any similar library is there.. or with out by default "concat" method can we go this ..?

Upvotes: 2

Views: 287

Answers (1)

imjared
imjared

Reputation: 20554

Perhaps you're looking for something like grunt-replace?

From the docs:

replace: {
  dist: {
    options: {
      variables: {
        'key': 'value'
      }
    }
  }
}

Upvotes: 1

Related Questions