Search code examples
webpackurlloaderraw-loader

Raw loader vs url loader in webpack


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?


Solution

  • 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.