-
-
Notifications
You must be signed in to change notification settings - Fork 603
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
v4 can't resolve absolute URLs #1153
Comments
Closing right away as this was just for documentation and because this appears to be expected behavior in v4. |
Thanks! I already found this workaround a few days before. I use the same workaround but just little simplified the code:
|
You can send a PR to docs, if you think it can help other, anyway may recommendation is rewrite url or use aliases for this |
Thank you for this, @brenc and @syberon I tried to update a while ago when 4.0.0 was released, and I got errors when building. Tried to do some small tweaks to my config based on the release notes to no effect. Did some more maintenance today, and saw this had gotten a few more releases. Perhaps it is working now. Checked out the issues: nope. Checked out the closed ones: yes! The first hit had me stumbling with aliases. Upgrading from version 3.5.3 to 4.2.2 resulted in "added 2 packages from 2 contributors", my webpack config growing from a simple Not unreasonable, though a minor hassle. I'm just hoping that by illustrating this with my simple use case, it might not be so in the future. Thank you for your great work and the time you put into this, @evilebottnawi. |
You should not ignore |
what kind? |
For a long, long time, I've included fonts and other static assets like this: I put the font file into the public folder, as it is static, and already optimized - it should not be touched, only referenced. Then I have some country flags, same thing as above, so I put some in the folder as well. Now, to make the font available to my app, I also add the corresponding css file for it.
that contains
and then I include it via For the country flags, I'd do I think this is quite a common way to use fonts and other static assets on websites without webpack. |
@oles Why do not change this to relative URL? If you put it in publish you should use:
Otherwise it is invalid server relative URL, try to open css file in browser |
For file-loader, from version 4.3.0 to 5.0.0, the config grew from I have still to read up on why that was needed. It most likely had good reasoning. For copy-webpack-plugin, from version 5.1.1 to 6.0.0, the config grew from Really minor that one. |
yes need to rewrite code on
expected because plugins should accept only object as options |
That's a fair point. It wouldn't work if I were to develop with plain html and css files opened in the browser. I'll have to consider. Most people do start to develop with just plain files. Perhaps it's better to just keep it that way - simpler, and it works regardless a server or not. |
you need to use same public path for static server and in webpack config |
There we have it. Makes sense. I've been bitten by that before.
Didn't know that was the case. Makes sense when so 👍 |
I've always had it as Thanks for the replies and the inputs! |
As I written above you need to use in your case @font-face {
font-family: 'Gotham';
font-weight: 400;
font-style: normal;
src: url('/public/fonts/gotham/Gotham-Book.woff') format('woff');
} |
Indeed, I'm gonna try it out next session - thanks! |
Creating a new bug report because #1136 was locked. Not trying to cause any problems. This is mainly for documentation for those of us who have been affected by this change, want to keep our deps up to date, but can't easily remove absolute URLs from our CSS right now. I found a really simple workaround for this:
This seems to work exactly as v3 did.
@syberon
@petertenhoor
The text was updated successfully, but these errors were encountered: