Package Exports
- img-compress-webpack-plugin
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (img-compress-webpack-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
img-compress-webpack-plugin
img-compress-webpack-pluginis a very lightweight webpack plugin that uses the excellent compression algorithm of the tinypng website to compress the image format
img-compress-webpack-plugin是一款十分轻量的 webpack 插件,利用 tinypng 网站优秀的压缩算法,对图片格式进行压缩
install(安装)
npm i -D img-compress-webpack-plugin
或
yarn add -D img-compress-webpack-plugin
config(配置)
| 配置 | 功能 | 格式 |
|---|---|---|
enabled |
enable plugin(是否启用插件) | true/false |
logged |
enable print log(是否启用插件是否打印日志) | true/false |
usage(使用)
const ImgCompressWebpackPlugin = require('img-compress-webpack-plugin');
module.exports = {
plugins: [
new ImgCompressWebpackPlugin({
enabled: true,
logged: true,
}),
],
};