lazd / lazd/gulp-replace

Only modify files that match the replace expression

Open
#70 9 comments 1 reaction 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

From what I can tell, the gulp-replace modifies all files regardless of whether they match the replace condition or not.

My scenario is that gulp-replace correctly updates my files but also my fonts, images and text files that are Unicode format. The skipBinary option successfully skips the fonts & images but my .txt files that have unicode characters in them are still left broken.

Some other skip options would be nice, but surely it would be better to skip modifying files unless they actually have a match?

Thoughts?

P.S. Thanks for providing a very useful module :)

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 tracing how gulp-replace decides whether to modify a file, including the existing skipBinary option. Reproduce the behavior with a text file containing Unicode characters and a non-matching replacement expression. Done means files without a match remain unchanged while matching files are still updated, with coverage for the reported case.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.