
Research
/Security News
npm Author Qix Compromised via Phishing Email in Major Supply Chain Attack
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
base64-inline-loader
Advanced tools
A Base64 loader for webpack. Encodes all binary files to Base64 strings.
npm
npm install base64-inline-loader --save
or
yarn
yarn add -D base64-inline-loader
const path = require('path');
module.exports = [
{
...
module: {
rules: [
{
test: /\.(jpe?g|png|ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
use: ['base64-inline-loader']
}
]
}
...
}
];
@font-face {
font-family: 'icons';
src: url('./icon.woff');
}
body {
background-image: url('./image.png');
}
@font-face {
font-family: 'icons';
src: url('data:application/x-font-woff;charset=utf-8;base64,[BASE_64_STRING...]')
}
body {
background-image: url('data:application/png;charset=utf-8;base64,[BASE_64_STRING...]');
}
limit
— The limit can be specified with a query parameter.{
use: {
loader: 'base64-inline-loader',
options: {
limit: 1000
}
}
}
typeMapper
— use this option to fix your non-standard MIME types{
use: [
{
loader: 'base64-inline-loader',
options: {
typeMapper: {
'text/less': 'text/css'
}
}
},
'less-loader'
]
}
<link rel="stylesheet" href="data:text/less;charset=utf-8;base64,Lm54dC1lcnJvci1wYW..." />
npm test
FAQs
A Base64 loader for Webpack
The npm package base64-inline-loader receives a total of 10,042 weekly downloads. As such, base64-inline-loader popularity was classified as popular.
We found that base64-inline-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.