Skip to content

Paths in opts are broken if cachebuster called multiple times #113

@betterthanclay

Description

@betterthanclay

When using postcss in Vite with Vue components, processors gets run multiple times on different files, and imported from the same ES6 scope.

The opts list at the start of postcss-cachebuster prepends process.cwd() to both path options on each run, so only the first run will have correct paths - everything afterwards will have cwd() added to it multiple times.

There's an easy fix - put the results of those prepends in opts.imagesPathResolved and opts.cssPathResolved and reference those in the code instead.

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