-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
When using a forward-slash in filename
, the wrong font url is generated
#877
Comments
Do not use |
Because filename is absolute path in this case, so URLs are wrong, we should improve schema |
If it is invalid, it should throw a build error in my opinion. I've waisted hours to find why webpack was generating the wrong paths in our complicated build setup, and I would like to prevent others wasting their time on sthis :) |
Yes, I describe it here #877 (comment), the fix is easy, we should add |
You can send a PR and help us, thanks! |
Bug report
When prefixing the
filename
using a forward-slash the wrong url path is generated in the css when referencing fonts (and probably other asset types).I have the following directory structure:
![image](https://user-images.githubusercontent.com/9316480/144749858-651492aa-828a-45bb-abb7-78c0b3276e4a.png)
With this webpack (5!) configuration:
This generates a font path in my (generated) css (from scss):
![image](https://user-images.githubusercontent.com/9316480/144749827-aef85675-d6f6-4463-9bbf-08e4372f1e50.png)
When removing the prefixed forward-slash in
![image](https://user-images.githubusercontent.com/9316480/144750062-2e91189e-2872-4892-91f0-ab0cccdc8c6c.png)
filename
, the following output is generated:Actual Behavior
The generated font urls contains a double directory upward crawl (
../../fonts/my-font
)Expected Behavior
The generated font url should contains a single directory upward (
../fonts/my-font
)How Do We Reproduce?
See above given webpack configuration and directory structure, or this zip contains the source:
mini-css-extract-plugin-bug-report.zip
Output of
npx webpack-cli info
:The text was updated successfully, but these errors were encountered: