assetsPath is ignored without useHash
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Reproduce the three postcss-url configurations described in the issue, comparing asset copying with useHash enabled and disabled. Trace how assetsPath is resolved during copy operations; done when the configured ../assets/ destination works without useHash and the existing relative-path behavior remains intact.
Written by the indexing model from the issue text.
Description
Found some unexpected behaviour when using assetsPath.
Scenario
CSS Source: /style/css_src/index.css
Font Assets: /style/fonts/
Image Assets: /style/images/
PostCSS Generated CSS: /style/css/index.css
I am referencing my assets as such:
@font-face {
font-family: 'MyFont';
src: url('../fonts/MyFont.eot') format('eot');
}
.myClass {
background-image: url('../images/MyImage.png')
}
Using the following configuration with useHash enabled, assets are copied and hashed into /style/assets/
require('postcss-url')({
url: "copy",
assetsPath: '../assets/',
useHash: true
})
However using the following configuration without useHash enabled, assets are not copied anywhere
{
url: "copy",
assetsPath: '../assets/',
useHash: false
}
And using the following configuration without useHash, assets are copied into /style/css/fonts & /style/css/images
{
url: "copy",
assetsPath: './assets/',
useHash: false
}
Just for extra reference, the following configuration will see the assets copied into /style/css/assets/fonts & /style/css/assets/images
{
url: "copy",
assetsPath: './assets/somewhereElse',
useHash: false
}
- Dominant language
- JavaScript
- Stars
- 383
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from postcss/postcss-url
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
postcss/postcss-url#183 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
postcss/postcss-url#182 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
postcss/postcss-url#181 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
postcss/postcss-url#180 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
postcss/postcss-url#179 ·
All issues in postcss/postcss-url
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·