
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
unplugin-compression
Advanced tools
Compress dist to
zip,tar,taz. Powered by unplugin.
English | 简体中文
pnpm i -D unplugin-compression
// vite.config.ts
import Compression from "unplugin-compression/vite";
export default defineConfig({
plugins: [
Compression({
/* options */
}),
],
});
// rollup.config.js
import Compression from "unplugin-compression/rollup";
export default {
plugins: [
Compression({
/* options */
}),
],
};
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require("unplugin-compression/webpack")({
/* options */
}),
],
};
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require("unplugin-compression/webpack")({
/* options */
}),
],
},
};
// esbuild.config.js
import { build } from "esbuild";
build({
/* ... */
plugins: [
require("unplugin-compression/esbuild")({
/* options */
}),
],
});
Compression({
// you can use `zip`, `tar`, `taz`
adapter: "zip",
// relative paths to the directory to compress
source: "dist",
// relative paths to the directory to output
outDir: "./",
// compressed file name
formatter: "{{name}}.{{ext}}",
});
adapterGlobal adapter. When the source does not set the adapter, the global adapter is used.
see compressing
sourceThe compress source, which can be set as string or Source or Source[]
If you use Source and set adapter or outDir or formatter options, it's cover global options.
Compression({
source: [
{
// zip adapter, dist.zip
source: "dist",
},
{
// tar adapter, output.tar
source: "output",
adapter: "tar",
},
],
});
outDirThe compressed file output dir.
formatterThe compressed filename formatter. default value is {{name}}.{{ext}}.
interface template extends Omit<Source, "formatter"> {
name: string;
ext: string;
}
you can also set a handler
Compression({
formatter(source) {
return `Hello.${source.adapter}`;
},
});
compressingOptionsthe compressing package opts. see compressing
Compression({
compressingOptions: {
ignoreBase: true,
},
});
FAQs
Compress dist to `zip`, `tar`, `taz`.
We found that unplugin-compression demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.