Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Problems when using non-glob paths #135

@heyimalex

Description

@heyimalex

The issue is here.

You're using glob-parent to get the base if one isn't explicitly set, but glob-parent doesn't work properly on non-glob paths.

var globParent = require('glob-parent');
globParent('some/path.html');
// 'some/path.html'

So that makes opts.base equal to the actual filename, which makes vinyl.relative an empty string. Especially bad since vinyl-fs uses relative in dest, so the file will be written to whatever string was given to dest.

Noticed this when using 4.1.0 and logging didn't display anything for the matched filename.

Temporary fix: explicitly provide base for any non-glob paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions