
Security News
Node.js Drops Bug Bounty Rewards After Funding Dries Up
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.
sprite-pr-loader
Advanced tools
sprite-loader
sprite-loader is an image sprite generate tool.It helps you to resolve the troublesome of make sprite manually.
npm install sprite-loader --save
// for webpack 1
loaders: [
{
test: /\.css/,
loader: 'style!css!sprite'
},
{
test: /\.scss$/,
loader: 'style!css!sprite!sass'
}
]
// for webpack 2
rules: [
{
test: /\.css/,
use: ['style-loader', 'css-loader', 'sprite-loader']
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sprite-loader', 'sass-loader']
}
]
First of all, add a comment in the first line of the file to enable sprite-loader.Then the loader will identify images and make sprites.
/* sprite-loader-enable */
.flip_flops {
width: 16px;
height: 16px;
background: url(./img/flip_flops@2x.png);
}
.tram {
width: 50px;
height: 50px;
background: url(./img/tram@2x.png);
}
.pie {
width: 100px;
height: 100px;
background: url(./img/pie@2x.png);
}
It's very easy to adapt Retina screen. You just need to use double size images and name them as xxx@2x.png. sprite-loader will generate 1x images and media query automatically.
sprite-loader will collect all the background and background-image attributes in css files to combine. Except for following circumstance:
Images that set the background-position and background-size.
/* ignore images that set background-position */
.bg1{background: url(1.png) no-repeat -10px -10px;}
/* ignore images that set background-size的 */
.bg2{background: url(2.png); background-size: 10px 10px;}
Image url that contain #spriteignore string.
/* ignore all images that contain #spriteignore */
.bg3{background: url(3.png#spriteignore);}
MIT
FAQs
A image sprite loader for webpack and support pr.
We found that sprite-pr-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.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.