Skip to content

\0 included in filename option is treated as a character terminator #874

@sapphi-red

Description

@sapphi-red

Reproduction: https://github.com/sapphi-red-repros/lightningcss-filename-containing-nul-character (run npm i && npm start)

In this reproduction resolver.read is called with foo instead of foo\0bar.css which is the filename and what I expect.

Additional context

In Vite (and Rollup), module id can contain any characters and some times starts with \0 (which is a convention for virtual modules: modules that does not exist on file system). While Vite can escape \0 to something else and unescape it back when needed, it would be nice if Vite can just pass in ids containing \0 to the filename option.

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