Skip to content

Conversation

bcomnes
Copy link
Contributor

@bcomnes bcomnes commented Aug 27, 2019

If you want to run post-css on the following arrangement:

postcss app/app.css -o app/app.bundle.css

Postcss-url will then save the copied assets to process.cwd(), which in this case is .. Not correct. It should copy the assets to ./app/${assetsPath}.

This fix makes it so the assets are correctly copied to the same folder (presumably inside of a assetsPath) when a to option exists. Otherwise, use the old cwd() behavior.

I'm not 100% sure what the intention of the original logic was, but it appeared to be guarding for when there was a missing to option. This will still preserve the original behavior when to is !existy and use process.cwd(). Apologies if this understanding is incorrect.

If you want to run post-css on the following arrangement:

`postcss app/app.css -o app/app.bundle.css`

Postcss-url will then save the copied assets to process.cwd(), which in this case is `.`.  Not correct. It should copy the assets to `app/${assetsPath}`.  

This fix makes it so the assets are correctly copied to the same folder (presumably inside of a `assetsPath`.  

I'm not 100% sure what the intention of the original logic was, but it appeared to be guarding for when there was a missing `to` option.  This will still preserve the original behavior when `to` is !existy and use process.cwd().  Apologies if this understanding is incorrect.
@ai ai requested a review from sergcen September 11, 2019 09:57
@sergcen sergcen merged commit 396829b into postcss:master Sep 19, 2019
@bcomnes
Copy link
Contributor Author

bcomnes commented Sep 19, 2019

🎉🙏TY! I can float off the git commit until you do the next release.

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.

2 participants