A tiny alternative to url-loader and file-loader for webpack 5, replacing deprecated loaders with asset modules. Current stable version is 0.1.1. The package is actively maintained with a simple API that delegates to webpack 5's built-in asset modules, providing backward compatibility for setups that still require a loader pipeline (e.g., @svgr/webpack). Unlike url-loader/file-loader, it uses webpack 5's native asset handling and has zero runtime dependencies beyond webpack 5 itself. Supports data URI inlining and separate file emission via asset type configuration.
npm install new-url-loaderVerified import paths — ran on the pinned version, not inferred.
Shows how to replace url-loader with new-url-loader for SVG files processed by @svgr/webpack, using webpack 5 asset modules.
Upgrade to webpack 5 and configure asset modules.
Add `dependency: { not: ['url'] }` to the loader rule as shown in the documentation.Update to 0.1.1 and expect string values instead of URL objects.
Run `npm install new-url-loader --save-dev`
Upgrade to webpack 5 or use url-loader/file-loader instead.