gulp-replace icon indicating copy to clipboard operation
gulp-replace copied to clipboard

Pass only one object which contains search string + replacement

Open timkraut opened this issue 10 years ago • 2 comments

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!

timkraut avatar Aug 08 '15 08:08 timkraut

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?

oleggromov avatar Mar 05 '16 09:03 oleggromov

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' }.

lazd avatar Aug 24 '16 16:08 lazd