
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
rollup-plugin-minify-es
Advanced tools
Rollup plugin to minify generated format into new minified file, with source maps, using uglify-es.
Rollup plugin to minify generated bundle.
npm i rollup-plugin-minify-es -D
import { rollup } from 'rollup';
import minify from 'rollup-plugin-minify-es';
rollup({
entry: 'main.js',
plugins: [
minify()
]
});
minify(options)
options
– default: {}
, type: object
. UglifyJS API options
minifier
– default: require('minify-js').minify
, type: function
. Module to use as a minifier. You can use other versions (or forks) of UglifyJS instead default one.
import { rollup } from 'rollup';
import minify from 'rollup-plugin-minify';
import { minify } from 'minify-es';
rollup({
entry: 'main.js',
plugins: [
minify({}, minify)
]
});
If you'd like to preserve comments (for licensing for example), then you can specify a function to do this like so:
minify({
output: {
comments: function(node, comment) {
var text = comment.value;
var type = comment.type;
if (type == "comment2") {
// multiline comment
return /@preserve|@license|@cc_on/i.test(text);
}
}
}
});
See UglifyJS documentation for further reference.
MIT
FAQs
Rollup plugin to minify generated format into new minified file, with source maps, using uglify-es.
The npm package rollup-plugin-minify-es receives a total of 330 weekly downloads. As such, rollup-plugin-minify-es popularity was classified as not popular.
We found that rollup-plugin-minify-es 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.