Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix copy with no hash #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix copy with no hash #146

wants to merge 1 commit into from

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?

@@ -72,7 +72,7 @@ module.exports = function processCopy(asset, dir, options, decl, warn, result, a

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.

None yet

4 participants