How to use the replaceExtension function from gulp-util

Find comprehensive JavaScript gulp-util.replaceExtension code examples handpicked from public code repositorys.

47
48
49
50
51
52
53
54
55
56
  },
},
function (err, result) {
  if (err) console.log('Error parsing SCSS', err);
  file.contents = result.css;
  file.path = gutil.replaceExtension(file.path, '.css');

  debug('Finished');

  cb(err, file);
fork icon62
star icon943
watch icon35

+ 3 other calls in file

151
152
153
154
155
156
157
158
159
160
        }
      }
    }

    file.contents = new Buffer(JSON.stringify(trans));
    file.path = gutil.replaceExtension(file.path, '.json');
    cb(null, file);
  });
  return stream;
})())
fork icon5
star icon7
watch icon7

63
64
65
66
67
68
69
70
71
72
function (output) {
  process.chdir(cwd);
  stream.push(new gutil.File({
    base: file.base,
    cwd: file.cwd,
    path: gutil.replaceExtension(file.path, options.extension),
    contents: new Buffer(output)
  }));
  done();
},
fork icon4
star icon5
watch icon9

8
9
10
11
12
13
14
15
16
17

module.exports = function (opt) {
  function replaceExtension(path) {
    path = path.replace(/\.coffee\.md$/, '.litcoffee');
    path = path.replace(/\.iced\.md$/, '.liticed');
    return gutil.replaceExtension(path, '.js');
  }

  function transform(file, enc, cb) {
    if (file.isNull()) return cb(null, file);
fork icon74
star icon0
watch icon2

50
51
52
53
54
55
56
57
58
59

var filePath = file.path;

try {
    file.contents = new Buffer("module.exports=" + pegjs.buildParser(file.contents.toString(), options));
    file.path = gutil.replaceExtension(file.path, '.js');
    this.push(file);
} catch (err) {
    this.emit('error', new gutil.PluginError('gulp-pegjs', err, {fileName: filePath}));
}
fork icon36
star icon0
watch icon1

3
4
5
6
7
8
9
10
11


function replaceExtension(path) {
        path = path.replace(/\.clj\.clj\.cljs$/)

        return gutil.replaceExtension(path, '.js')
}

module.exports = replaceExtension
fork icon2
star icon2
watch icon3