Skip to content

Files with \0 in the name are always rejected from createFilter #749

@AlexVipond

Description

@AlexVipond

Expected Behavior

createFilter shouldn't care if \0 is in the file ID, and it shouldn't care if the file is virtual or not (virtual files are conventionally prefixed with \0virtual:)

Actual Behavior

createFilter rejects files with \0 in the ID (e.g. virtual files) outright:

if (/\0/.test(id)) return false;

Additional Information

The particular use case I have right now is:

  1. Taking an SVG icon as an input, construct a virtual file whose code is a single file Vue component wrapping the SVG code.
  2. Use rollup-plugin-vue to compile the virtual component file down to a plain JS render function for the browser.

Since rollup-plugin-vue uses createFilter under the hood, virtual files are rejected outright, and the component is not properly processed at build time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions