Anyone know the difference between the raw loader vs url loader in webpack? does the url loader do the same as raw, except falls back to file-loader at a certain file size?
Asked
Active
Viewed 2,127 times
1
-
raw loader loads the text in the file where it is required, where as url-loader fixed the url paths in the file that it loads. they are way different – harishr Nov 08 '16 at 08:54
-
1can you explain more fully with example, and put in answer? @entre – SuperUberDuper Nov 08 '16 at 13:57
1 Answers
4
url-loader
Loads the images you load via url(./some-asset.jpg)
in your css files, converts them to base64 and places them instead of the url() statement.
raw-loader
Loads the file as string, it doesn't convert the images to base64, and is used more for text or css files.

Shai Reznik - HiRez.io
- 8,748
- 2
- 33
- 33
-
Depends on the use case, for example - it's great for loading templates – Shai Reznik - HiRez.io Feb 09 '17 at 23:35