lazd / lazd/gulp-replace

Use the same replace in multiple pipes

Open
#21 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
495
Forks
87
PR merge metrics
No merged PRs in 30d

Description

When I use the same replace in two pipes, one of the two pipes seemst to fail.

I try something like this:

var replace = require('gulp-replace');

var replaceStuff = replace(/foo/, function (match) {
  // ... do stuff...
  return 'bar';
});

return gulp.src('path')
      .pipe(replaceStuff)
      .pipe(gulp.dest('dest'));

return gulp.src('other/path')
      .pipe(replaceStuff)
      .pipe(gulp.dest('other/dest'));

Is this a bug or am I overlooking something?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two gulp pipelines shown in the issue, using the same replace instance for both paths. Inspect gulp-replace's stream entry point to determine why the second pipeline fails, then add coverage for both pipelines and verify that each replacement completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.