Filter doesn't work
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- build-system
Research direction
Reproduce the issue with the listed dependencies, CSS import, and PostCSS config. Compare the filtered and unfiltered output, then trace how the postcss-url filter handles the .woff2 URLs. Done means the filtered run rewrites the font URL to the node_modules/@fontsource/raleway path shown in the expected output.
Written by the indexing model from the issue text.
Description
Dependencies:
- "postcss-cli": "9.1.0",
- "postcss-import": "14.0.2",
- "postcss-url": "10.1.3"
- "@fontsource/raleway": "4.5.0"
CSS Code
@import '@fontsource/raleway/variable.css';
PostCSS config
module.exports = {
plugins: [
require('postcss-import'),
require('postcss-url')([
{
filter: '**/*.woff2',
url: (asset) => {
return `node_modules/@fontsource/raleway/${asset.url.replace('./', '')}`;
}
}
]
};
Error
Running the post CSS Cli return output containing the following part:
@font-face {
font-family: 'RalewayVariable';
font-style: normal;
font-display: swap;
font-weight: 100 900;
src: url('./files/raleway-cyrillic-variable-wghtOnly-normal.woff2') format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
If I remove the filter, I get the expected output:
@font-face {
font-family: 'RalewayVariable';
font-style: normal;
font-display: swap;
font-weight: 100 900;
src: url('node_modules/@fontsource/raleway/files/raleway-cyrillic-variable-wghtOnly-normal.woff2') format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
- 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 ·