hparra / gulp-rename

Rename files easily
MIT License
692 stars 73 forks source link

Function Style Not Respecting Suffix #95

Open XedinUnknown opened 3 years ago

XedinUnknown commented 3 years ago

When trying to add a suffix in a function-style rename() call, the suffix gets ignored.

rename(path => {
    let newPath = {
        dirname: path.dirname,
        basename: path.basename,
        extname: path.extname,
        suffix: '.min',
    }
    log(newPath)

    return newPath
})

Output of log() together with debug():

{
  dirname: 'src/modules/WooCommerce/public/css',
  basename: 'admin',
  extname: '.css',
  suffix: '.min'
}
[17:55:40] gulp-debug: build/src/modules/WooCommerce/public/css/admin.css

This makes sense: the suffix and prefix are not being joined in the function-style scenario like they are in the object-stye scenario.