Useful or not, from you.
replace-in-file How to use it with Gulp?

I want to replace all lines 'img/sprite.png' with on strings '../img/sprite.png' The lines are in the file (style.min.css) I am doing something wrong... I have errors, please help me

0

function fixSprites() {
    const results = replace.sync({
        files: config.build.style + '/style.min.css',
        from: 'img/sprite.png',
        to: '../img/sprite.png',
        countMatches: true,
    })
    return src(config.build.style + '/style.min.css')
        .pipe(replace(results))
}

exports.fixSprites = fixSprites()
That's a useful answer
Without any help

Это автономный модуль Node, я не думаю, что вы можете просто так использовать его в Gulp. Вместо этого вам нужно обернуть его вспомогательной функцией следующим образом:

module.exports = function updateRedirects(done) {
  replaceInFile({
    files: path.join(build.DEST_ASSETS, '_redirects'),
    from: /%API_BASE_URL%/g,
    to: config.api.baseUrl,
  }, done);
};

А затем используйте его в Gulp, например, с помощью gulp.seriesилиgulp.parallel

Tell me can I do this with any node.js plugin? I've tried doing something similar with other node.js plugins but it didn't work. What might it depend on? What do I need to know to adopt any other node.js plugin for gulp? I am asking you because I believe you are an expert in this area.