
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
image-webp-loader
Advanced tools
With webpack-loader to convert ordinary picture format to webp pictures, you can produce original pictures and webp pictures together and keep the same hash
Your can with webpack-loader to convert ordinary picture format to webp pictures, you can produce original pictures and webp pictures together and keep the same hash
npm install image-webp-laoder --save-dev
Here is the example of using image-webp-laoder
, after packaging will produce the original picture and webp picture to the specified path:
rules: [
{
test: /\.(png|jpe?g)$/i,
use: [
{
loader: 'image-webp-loader',
options: {
publicPath: '/',
outputPath: resolve(__dirname, './dist'),
name: 'images/[name].[hash].[ext]'
}
}
]
}
]
Name | Type | Default | Description |
---|---|---|---|
name | String | [name].[hash].[ext] | Configure a custom filename template for your file |
publicPath | String | '/' | Configure a custom public path for your file, but you should note that there is an interaction with module.exports.output.publicPath |
outputPath | String | resolve(__dirname, '../../dist') | Configure a custom output path for your file (distPath ) |
quality | Int | 100 | Set webp picture compression quality, (1~100 ) |
requestWebp | Boolean | false | Whether to directly request webp pictures |
FAQs
With webpack-loader to convert ordinary picture format to webp pictures, you can produce original pictures and webp pictures together and keep the same hash
The npm package image-webp-loader receives a total of 1 weekly downloads. As such, image-webp-loader popularity was classified as not popular.
We found that image-webp-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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.