hparra / gulp-rename

Rename files easily
MIT License
692 stars 73 forks source link

Rename via function - Maximum call stack size exceeded #87

Closed pensierinmusica closed 5 years ago

pensierinmusica commented 5 years ago

Hi, using Gulp v4.0.2 and gulp-rename v1.4.0, I get a RangeError: Maximum call stack size exceeded error, with this code:

const { dest, src } = require('gulp');
const grename = require('gulp-rename');

exports.rename = function () {
  return src('./*.txt')
    .pipe(grename(path => {
      path.basename = path.basename.replace(/foo/, 'bar');
    }))
    .pipe(dest('./dist'));
};
pensierinmusica commented 5 years ago

Nevermind, my mistake.

zepang commented 4 years ago

I get into trouble in the same mistake,could you tell me the resolution?