Skip to content

Conversation

johnagan
Copy link

@johnagan johnagan commented Aug 19, 2020

I realize this repo isn't touched often, but I think it's a great plugin.

I came across an issue where if I used copy and { useHash: false } it wouldn't copy the file. Took me longer to diagnose than it did to fix.

Basically the existing code is referencing the full path to the existing file, unless it's replaced with a hashed filename. So I just replace the full path with the basename of the file.

@martinapitakova
Copy link

  • 1, this fixed my problem!

@thiagomajesk
Copy link

Hey, @johnagan same problem here! Since I don't think this PR will be merged anytime soon, what's the solution you are using in the meantime?

const assetRelativePath = options.useHash
? getHashName(file, options.hashOptions)
: asset.relativePath;
: path.basename(file.path);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a test that fails without this commit and passes with it?

TigersWay added a commit to TigersWay/postcss-url that referenced this pull request Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants