
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
astro-compressor
Advanced tools
A gzip and brotli compressor for Astro
integrations
property to ensure all the generated files are compressed.Install via your tool of choice:
# Using NPM
npx astro add astro-compressor
# Using Yarn
yarn astro add astro-compressor
# Using PNPM
pnpm astro add astro-compressor
To compress your files, simply run pnpm build
and look for the compression messages in the build log.
First, install the package with your favorite package manager: pnpm add --dev astro-compressor
,
then configure it in your astro.config.*
file in the integrations
property:
import { defineConfig } from "astro/config";
import compressor from "astro-compressor";
export default defineConfig({
// ...
integrations: [..., compressor()],
});
You can also optionally enable and/or disable either the gzip or brotli compression by passing an options object to the compressor:
import { defineConfig } from "astro/config";
import compressor from "astro-compressor";
export default defineConfig({
// ...
integrations: [..., compressor({ gzip: true, brotli: false })],
});
Or customize the file formats that will be compressed:
import { defineConfig } from "astro/config";
import compressor from "astro-compressor";
export default defineConfig({
// ...
integrations: [..., compressor({
fileExtensions: [".html"] // only compress HTML files
})],
});
By default the fileExtensions
array is [".css", ".js", ".html", ".xml", ".cjs", ".mjs", ".svg", ".txt"]
.
MIT.
FAQs
A gzip and brotli compressor for Astro
The npm package astro-compressor receives a total of 9,827 weekly downloads. As such, astro-compressor popularity was classified as popular.
We found that astro-compressor demonstrated a healthy version release cadence and project activity because the last version was released less than 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.