This is a fork of the original repo with the changes we needed since things were going pretty slow upstream.
Built on top of replace, grunt-sed is a Grunt plugin for performing search and replace on files.
This plugin is a multi task, meaning that Grunt will automatically iterate over all exec targets if a target is not specified.
path
- File or directory to search. Defaults to'.'
.pattern
- String or regex that will be replaced byreplacement
. Required.replacement
- The string that will replacepattern
. Can be a function. Required.recursive
- Iftrue
, will recursively search directories. Defaults tofalse
.include
- String or array of files to include.exclude
- String or array of files/folders to exclude.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sed: {
version: {
pattern: '%VERSION%',
replacement: '<%= pkg.version %>',
recursive: true,
exclude: ['*.min.js', 'node_modules']
}
}
});
Copyright (c) 2013 Jake Harding
Licensed under the MIT License.