levelio / yc-webp-webpack-plugin

为洋葱webp生成提供的webpack plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yc-webp-webpack-plugin

洋葱学院Png/Jpg转WebP格式化工具

Installation

npm install yc-webp-webpack-plugin

Usage

const path = require('path');
const YcWebpackPlugin = require('yc-webp-webpack-plugin');
module.exports = {
    mode: 'development',
    entry: "./index.js",
    output: {
        path: __dirname + '/dist/',
        filename: "bundle.js"
    },
    plugins:[
        new YcWebpackPlugin({
            path: path.resolve(__dirname, './img/*'),
            compressOption: {
                q: 75
            }
        })
    ]
};

具体配置请参考ycwebp

About

为洋葱webp生成提供的webpack plugin


Languages

Language:JavaScript 100.0%