Webpack loader that returns image metadata (base64 URI, width, height) as a JavaScript object. Version 0.6.5 is the latest; last published in 2022. It differentiates from simple base64 loaders by also providing image dimensions. Designed for Rax framework, but usable in any webpack project. The loader supports common image formats (see mimes.json). Release cadence: infrequent, no recent updates.
npm install image-source-loaderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configure webpack to use image-source-loader for PNG/JPG files, then import an image to get its base64 URI and dimensions.
Access source.uri for the base64 string, source.width and source.height for dimensions.
Use require('image-source!./file.png') or import from 'image-source!./file.png'.Check mimes.json in the package for supported extensions. Add custom mime support if needed.
In webpack config use 'image-source-loader' as the loader name. For inline usage, use 'image-source!' (with exclamation).
Access source.uri to get the base64 string.