{"id":19381,"library":"base64-loader","title":"base64-loader","description":"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.","status":"deprecated","version":"1.0.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/antelle/base64-loader","tags":["javascript"],"install":[{"cmd":"npm install base64-loader","lang":"bash","label":"npm"},{"cmd":"yarn add base64-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add base64-loader","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"In webpack config, the loader is referenced as a string, not imported directly. Can also be used inline: require('base64!./file.txt').","wrong":"require('base64-loader')","symbol":"base64-loader (webpack loader)","correct":"module.exports = { module: { rules: [ { test: /\\.txt$/, use: 'base64-loader' } ] } }"}],"quickstart":{"code":"// webpack.config.js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.(png|jpg|gif)$/,\n        use: 'base64-loader'\n      }\n    ]\n  }\n};\n\n// In your code\nimport logo from './logo.png';\nconsole.log(logo); // base64 string","lang":"javascript","description":"Shows how to configure webpack to convert image imports to base64 strings using base64-loader."},"warnings":[{"fix":"Use webpack's asset modules (type: 'asset/inline') or url-loader instead.","message":"Package is unmaintained and incompatible with webpack 4 and 5.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Upgrade to a modern loader or webpack asset modules.","message":"Only works with webpack 1-3; no updates since 2015.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Add base64-loader to webpack config or use inline require('base64!./file.png').","cause":"Trying to require a binary file without proper loader configuration.","error":"Module parse failed: Unexpected character 'ÿ'"},{"fix":"Run 'npm install base64-loader' and ensure the string in webpack config matches exactly.","cause":"Missing npm install or incorrect loader name.","error":"Cannot find module 'base64-loader'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}