一覧へ戻る
HZZformGD/rollup-plugin-tinyimg(新しいタブで開きます)
主要言語: JavaScript
a rollup plugin to compress image using tinypng or tinyjpg
- star 数
- 5
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2022/05/31
主要言語: JavaScript
a rollup plugin to compress image using tinypng or tinyjpg
Using tinypng or tinyjpg to compress your images.(works in vite)
🇨🇳 中文版介绍
# yarn yarn add rollup-plugin-tinyimg -D # npm npm install rollup-plugin-tinyimg -D
// rollup.config.js import tinyimg from "rollup-plugin-tinyimg"; export default { input: "src/index.js", output: { file: "dist/app.js", format: "cjs", }, plugins: [ tinyimg({ input: resolve(__dirname, "public"), output: resolve(__dirname, "dist"), }), ], };
There are some useful options:
Type: String
it's input dir name :
tinyimg({ input: resolve(__dirname, "public"), });
Type: String
it's output dir name :
tinyimg({ output: resolve(__dirname, "dist"), });
Type: Regx| default /\.(jpe?g|png|webp)$/
Match the suffix of the image to be compressed
tinyimg({ ..., imageRegx: /\.(jpe?g|png|webp)$/, });
MIT