@ort-fe/make-img-tiny-loader
v0.0.6
Published
Use [tinypng.com](https://tinypng.com) upload/download achieve compress images
Downloads
4
Readme
make-img-tiny-loader
Use tinypng.com upload/download achieve compress images
常见问题
https://cloud.tencent.com/developer/article/1363596
Feature
- [X] Mini size
- [X] Cache
Install
$ yarn add --dev @ort-fe/make-img-tiny-loader
OR
$ npm i --save-dev @ort-fe/make-img-tiny-loader
Usage
const path = require('path')
module.exports = {
mode: 'development',
entry: {
app: path.join(__dirname, './demo/index.js') // 打包内容入口
},
output: {
path: path.join(__dirname, './test/') // 出口
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: 'babel-loader'
},
{
test: /\.(png|jpg|gif)$/i,
use: [
{
loader: 'url-loader',
options: {
limit: 10000,
name: 'img/[name].[ext]',
publicPath: '/'
}
},
{
loader: '@ort-fe/make-img-tiny-loader'
}
]
}
]
},
optimization: {
minimize: false
}
}