copy fonts
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- css, javascript, nextjs
- Domain
- build-system, tooling
Research direction
Start by reproducing the shown postcss-url configuration against the relative font URL in node_modules/my-styleguide/dist/build/styleguide.css. Trace how basePath and assetsPath are resolved and verify whether the expected result is copied fonts under /.next/static/ with rewritten URLs; the issue is done when that build completes without the reported missing-module error.
Written by the indexing model from the issue text.
Description
Hi, i know that you do not encourage the use of copy, but i have a tricky need.
I have a node_module with a css file and relative font urls :
@font-face{font-family:"Avenir";src:url("./fonts/avenir-lighter.woff") format("woff")}
My app uses Nextjs and with style-loader + css-loader, my css module is well integrated to the output /.next/static/style.css but font files url are not copied magically to that folder.
So i want to use postcss-url to copy all fonts files to /.next/static/ and adapt url to point to that files.
I try that :
module.exports = {
plugins: [
require('postcss-url')({
url: 'copy',
basePath: `${path.resolve('node_modules/my-styleguide')}/dist/build/`,
assetsPath: '/.next/static/',
}),
]
};
Sadly, it doesn't work and i get the following error :
These relative modules were not found:
- ../../../../.next/static/fonts/avenir-bold-black-heavy.woff in ./node_modules/my-styleguide/dist/build/styleguide.css
Have you got any idea ?
Thx
- 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 ·