
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
image-web-loader
Advanced tools
用于react-native for web的webpack 图片加载器
支持web端根据devicePixelRatio 来加载@1x @1.5x @2x @3x @4x
例如: require('image/a.jpg'); --> images/a@1x.jpg .....
或者 require('image!x')
npm install image-web-loader --save-dev
Webpack config example:
const RequireImageXAssetPlugin =require('image-web-loader').RequireImageXAssetPlugin;
module.exports = {
plugins:[
....
new RequireImageXAssetPlugin(path.resolve('assets/images'))
]
module: {
loaders: [
{
test: /\.(gif|jpeg|jpg|png|svg)$/,
loader: 'image-web-loader!file-loader',
query: {
//true: require('a.jpg') 返回url 否则返回{width:xx,height:xx,uri:xxx}
onlyWeb:false,
progressive: true,
optimizationLevel: 7,
interlaced: false,
pngquant: {
quality: '65-90',
speed: 4
}
}
}
]
}
}
Code example:
// ---> {uri:'xxx/hello(@1x|@1.5x|@2x|@3x|@4x).png',width:xx,height:xx}
require('./image/icon.png')
// ---> {uri:'xxx/assets/images/hello.(png|gif|jpg|ico|bmp)',width:xx,height:xx}
require('image!hello')
基于 MIT License 开源,使用代码只需说明来源,或者引用 license.txt 即可。
FAQs
react-native mode image loader for webpack
We found that image-web-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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.