You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

image-webp-loader

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

image-webp-loader

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

1.2.0
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

npm

image-webp-laoder

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

Install

npm install image-webp-laoder --save-dev

Usage

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]'
        }
      }
    ]
  }
]

Options

NameTypeDefaultDescription
nameString[name].[hash].[ext]Configure a custom filename template for your file
publicPathString'/'Configure a custom public path for your file, but you should note that there is an interaction with module.exports.output.publicPath
outputPathStringresolve(__dirname, '../../dist')Configure a custom output path for your file (distPath)
qualityInt100Set webp picture compression quality, (1~100)
requestWebpBooleanfalseWhether to directly request webp pictures

License

MIT

Keywords

webp

FAQs

Package last updated on 19 Sep 2018

Did you know?

Socket

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.

Install

Related posts