Skip to content

Instantly share code, notes, and snippets.

@rtgibbons
Created February 21, 2013 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtgibbons/5009517 to your computer and use it in GitHub Desktop.
Save rtgibbons/5009517 to your computer and use it in GitHub Desktop.
grunt string-replace
'string-replace': {
optimized: {
files: {
'source/index.html': 'source/index.html'
},
options: {
replacements: [{
pattern: /static\/js\/main/,
replacement: 'static/js/main.optimized'
}]
}
},
stage: {
files: {
'source/index.html': 'source/index.html'
},
options: {
replacements: [{
pattern: /src\=\"static/g,
replacement: 'src="' + STAGE_CDN + '/chase/' + TSTAMP + '/static'
},{
pattern: /href\=\"static/g,
replacement: 'href="' + STAGE_CDN + '/chase/' + TSTAMP + '/static'
},{
pattern: /data-main\=\"static/g,
replacement: 'data-main="' + STAGE_CDN + '/chase/' + TSTAMP + '/static'
}]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment