Registry / serialization / base64-loader

base64-loader

JSON →
library1.0.0jsnpmunverified

Base64 file loader for webpack (v1.0.0, last updated circa 2015). Converts file imports to base64-encoded strings at build time. Purely a webpack loader, no runtime dependencies. Minimal documentation; commonly used for embedding small assets like images or fonts as base64 URIs. Note: This package is outdated and may not work with modern webpack versions (v4/v5). Consider using `url-loader` with `limit` option or `asset modules` in webpack 5.

npm install base64-loader
INSTALL
IMPORT
SIG · BASE64-LOADER
B
base64-loader
serializationjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

base64-loader (webpack loader)
module.exports = { module: { rules: [ { test: /\.txt$/, use: 'base64-loader' } ] } }
require('base64-loader')
In webpack config, the loader is referenced as a string, not imported directly. Can also be used inline: require('base64!./file.txt').

Shows how to configure webpack to convert image imports to base64 strings using base64-loader.

// webpack.config.js module.exports = { module: { rules: [ { test: /\.(png|jpg|gif)$/, use: 'base64-loader' } ] } }; // In your code import logo from './logo.png'; console.log(logo); // base64 string
Debug
Known issues
deprecatedPackage is unmaintained and incompatible with webpack 4 and 5.
fix
Use webpack's asset modules (type: 'asset/inline') or url-loader instead.
affects: >=1.0.0
gotchaOnly works with webpack 1-3; no updates since 2015.
fix
Upgrade to a modern loader or webpack asset modules.
affects: >=1.0.0
Errors
Common errors & fixes
Module parse failed: Unexpected character 'ÿ'
Trying to require a binary file without proper loader configuration.
fix
Add base64-loader to webpack config or use inline require('base64!./file.png').
Cannot find module 'base64-loader'
Missing npm install or incorrect loader name.
fix
Run 'npm install base64-loader' and ensure the string in webpack config matches exactly.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
base64-loader — npm install base64-loader · libregistry