-
-
Notifications
You must be signed in to change notification settings - Fork 384
When using a forward-slash in filename
, the wrong font url is generated
#877
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
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:

With this webpack (5!) configuration:
This generates a font path in my (generated) css (from scss):

When removing the prefixed forward-slash in

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: