Skip to content

Instantly share code, notes, and snippets.

@stevenacalhoun
Created August 25, 2014 21:49
Show Gist options
  • Save stevenacalhoun/91498a3fc80dff4f9056 to your computer and use it in GitHub Desktop.
Save stevenacalhoun/91498a3fc80dff4f9056 to your computer and use it in GitHub Desktop.
Grunt replace
replace: {
dist: {
options: {
patterns: [
{
match: /("|'?)\/?styles\//g,
replacement: '$1http://www.ece.msstate.edu/courses/design/2014/team_amacker/styles/'
},
{
match: /("|'?)\/?scripts\//g,
replacement: '$1http://www.ece.msstate.edu/courses/design/2014/team_amacker/scripts/'
},
{
match: /("|'?)\/?fonts\//g,
replacement: '$1http://www.ece.msstate.edu/courses/design/2014/team_amacker/fonts/'
},
{
match: /(<a[^>]*href="?)(\/)/g,
replacement: '$1http://www.ece.msstate.edu/courses/design/2014/team_amacker/'
},
{
match: /(<form[^>]*action="?)(\/)/g,
replacement: '$1http://www.ece.msstate.edu/courses/design/2014/team_amacker/'
}
]
},
files: [
{
expand: true,
src: ['dist/**/*.html', 'dist/scripts/*.js', 'dist/styles/*.css']
}
]
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment