lazd / gulp-replace

A string replace plugin for gulp
MIT License
496 stars 88 forks source link

Pass only one object which contains search string + replacement #57

Open timkraut opened 9 years ago

timkraut commented 9 years ago

Hi,

maybe you could include an option to pass only 1 object to replace(). This would allow me to keep my configuration separate from the task. At the moment, I have to pass 2 arguments which contradicts somehow the idea to have a single configuration object for each plugin.

This would be awesome! Thanks in advance!

oleggromov commented 8 years ago

This idea sounds good for me! There are also a bunch of gulp-plugins that take one argument filled by the whole configuration object (for example, gulp-babel, gulp-postcss, autoprefixer), so it seems to be a neat improvement. Сhanging configuration format also correlates with #50 and probably will fulfil the major release idea.

@lazd How do you think?

lazd commented 8 years ago

I would be -1 for replacing the two argument approach completely, but it might be acceptable to pass a single object as an alternative. Perhaps just { search: 'x', replace: 'y' }.