1.2.1 • Published 6 years ago

image-webp-loader v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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-loader --save-dev

Usage

Here is the example of using image-webp-loader, 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]'
        }
      }
    ]
  }
]
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

1.2.1

6 years ago

1.2.0

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.2

6 years ago

0.0.0

6 years ago

0.0.1

6 years ago