Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
veimagex-webpack-plugin
Advanced tools
一款 webpack 插件,可以将代码中引入的本地图片资源上传至云端(veImageX),快速接入 veImageX 提供的云端处理能力,并且能够根据浏览器的支持情况加载高压缩率格式的图片,以优化图片加载速度,使用前请先开通[`veImageX图片服务`](https://t.zijieimg.com/dnbVv2k/)
一款 webpack 插件,可以将代码中引入的本地图片资源上传至云端(veImageX),快速接入 veImageX 提供的云端处理能力,并且能够根据浏览器的支持情况加载高压缩率格式的图片,以优化图片加载速度,使用前请先开通veImageX图片服务
// use npm
npm install veimagex-webpack-plugin --save-dev
// use yarn
yarn add veimagex-webpack-plugin --dev
插件分为两部分:
loader部分的使用方法同 file-loader
,支持 file-loader 的所有参数,新增了用于图片上传和处理的参数,file-loader相关参数主要用于上传失败后的文件处理
// webpack.config.js
const ImagexWebpackPlugin = require('veimagex-webpack-plugin');
// 引入loader
module: {
rules: [
{
loader: ImagexWebpackPlugin.loader,
test: /\.(png|jpe?g)$/i,
options: {
outputPath: 'static/media',
name: '[name].[hash:8].[ext]',
serviceId: '<veImageX服务ID>',
template: '<veImageX模板名称>',
domain: '<veImageX上绑定的域名>',
params: '<参数数组>', // 如果模板中有url参数则需要指定
accessKey: '<火山引擎accessKey>',
secretKey: '<火山引擎secretKey>',
region: 'cn' | 'sg' | 'us', // 上传区域
},
}
]
},
// 引入plugin
plugins: [
new ImagexWebpackPlugin(HtmlWebpackPlugin, {
format: 'webp' | 'heif' | 'avif', // 目标图片格式
})
]
不要对同一个图片文件同时使用 file-loader 和 veimagex-webpack-plugin
FAQs
一款 webpack 插件,可以将代码中引入的本地图片资源上传至云端(veImageX),快速接入 veImageX 提供的云端处理能力,并且能够根据浏览器的支持情况加载高压缩率格式的图片,以优化图片加载速度,使用前请先开通[`veImageX图片服务`](https://t.zijieimg.com/dnbVv2k/)
We found that veimagex-webpack-plugin 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.