Skip to content

babel-preset: handles relative paths as assets #313

@layershifter

Description

@layershifter

In the fixture below assetWithHash contains a url() that uses relative path (not imported path).

export const useStyles = makeStyles({
rootA: { backgroundImage: `url(${blank})` },
rootB: { backgroundImage: `url("${blankDuplicate}")` },
rootC: { backgroundImage: `url(${empty})` },
assetWithHash: { filter: 'url(./a.svg#a)' },
});

⬇️⬇️⬇️

`.fv04sme{-webkit-filter:url(${_asset3}#a);filter:url(${_asset3}#a);}`,

url() there should not be transformed there, but it gets 💥
It seems that without migration to Linaria v4 (#184) that uses absolute paths it will be impossible to handle this scenario properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions