0.0.1 • Published 5 months ago
psimage v0.0.1
psimage
gulp plugin for jpg/png/svg image optimization and minify. based on imagemin.
install:
npm add -D psimage
sample:
import { src, dest, series, watch } from "gulp";
import imagemin from "psimage";
// images task
function images() {
return src(["src/**/*.*"], { base: "src", encoding: false }).pipe(imagemin()).pipe(dest("dist"));
}
// watch
function watcher() {
watch("src/**/*.{jpg,png,svg}", images);
}
// export
export { images };
export const dev = series(images, watcher);
options:
imagemin( mozjpegOptions?: {}, optipngOptions?: {}, svgoOptions?: {}, silent?: boolean, verbose?: boolean )
default options:
imagemin(
(mozjpegOptions = { quality: 75, progressive: true }),
(optipngOptions = { optimizationLevel: 5 }),
(svgoOptions = { plugins: [{ name: "preset-default", params: { overrides: { removeViewBox: false } } }] }),
(silent = false),
(verbose = true)
);
MIT License. ©2025 pasmurno by llcawc. Made with ❤ to beautiful architecture
0.0.1
5 months ago