
Research
/Security News
11 Malicious Go Packages Distribute Obfuscated Remote Payloads
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
rollup-plugin-brotli
Advanced tools
Creates a compressed .br
artifact for your Rollup bundle.
This uses the built in Node Brotli APIs, and as such requires Node v11.7.0 or higher
Based off of @kryops' rollup-plugin-gzip.
npm install --save-dev rollup-plugin-brotli
import {rollup} from "rollup";
import brotli from "rollup-plugin-brotli";
rollup({
entry: 'src/index.js',
plugins: [
brotli()
]
}).then(/* ... */)
import zlib from "zlib";
brotli({
test: /\.(js|css|html|txt|xml|json|svg|ico|ttf|otf|eot)$/, // file extensions to compress (default is shown)
options: {
params: {
[zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_GENERIC,
[zlib.constants.BROTLI_PARAM_QUALITY]: 7 // turn down the quality, resulting in a faster compression (default is 11)
}
// ... see all options https://nodejs.org/api/zlib.html#zlib_class_brotlioptions
},
additional: [
// Manually list more files to compress alongside.
'dist/bundle.css'
],
// Ignore files smaller than this
minSize: 1000
})
options: Brotli compression options
The options available are the standard options for the zlib.createBrotliCompress
builtin.
additional: Compress additional files
This option allows you to compress additional files that were created by other Rollup plugins.
minSize: Minimum size for compression
Specified the minimum size in Bytes for a file to get compressed. Files that are smaller than this threshold will not be compressed. This applies to both the generated bundle and specified additional files.
MIT
FAQs
Compress your Rollup bundle with Brotli
The npm package rollup-plugin-brotli receives a total of 26,117 weekly downloads. As such, rollup-plugin-brotli popularity was classified as popular.
We found that rollup-plugin-brotli 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.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).