-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Get image requiring working with url-loader #72
Comments
FYI, base64 string is inside Also, the logo image has the base64 in source, but the kitten image has a link to a .jpg named like |
That's working as intended. It only encodes images under a certain threshold. |
okay cool. also I think i have a fix. ill get a PR here for you to look at here in a few minutes |
basically that fix is checking image.source, finding the index of the first double quote slicing at that point and chopping the last character(also a double quote) off. then checks if the string starts with if it does, then use that, if not then append publicPath to it and use that. Seems to be working for me on Windows, can't test mac. |
Works on Mac. Well done! 👍 |
👍 |
Ideally we want to use
url-loader
for image files to capture small files as base64 encoded strings to reduce the number of http requests to the server, but the image requiring solution that solved #39 does not work withurl-loader
.Someone needs to investigate. The base64 string is probably in
webpack-stats.json
somewhere. It's just a matter of makingrequireServerImage()
smart enough to use it instead.The text was updated successfully, but these errors were encountered: