Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@ampproject/rollup-plugin-closure-compiler
Advanced tools
Leverage Closure Compiler to minify and optimize JavaScript with Rollup.
Generally Closure Compiler will produce superior minification than other projects, but historically has been more difficult to use. The goal of this plugin is to reduce this friction.
yarn add @ampproject/rollup-plugin-closure-compiler --dev
Invoke Closure Compiler from your Rollup configuration.
// rollup.config.js
import compiler from '@ampproject/rollup-plugin-closure-compiler';
export default {
input: 'main.js',
output: {
file: 'bundle.js',
format: 'iife',
},
plugins: [
compiler(),
],
}
If you would like to provide additional flags and options to Closure Compiler, pass them via key-value pairs.
// rollup.config.js
import compiler from '@ampproject/rollup-plugin-closure-compiler';
export default {
input: 'main.js',
output: {
file: 'bundle.js',
format: 'iife',
},
plugins: [
compiler({
formatting: 'PRETTY_PRINT'
}),
],
}
This plugin will modify the enable the assume_function_wrapper
output option for Closure Compiler when es
format is specifed to Rollup. Note: This is overrideable via passed flags and options.
// rollup.config.js
import compiler from '@ampproject/rollup-plugin-closure-compiler';
export default {
input: 'main.js',
output: {
file: 'bundle.js',
format: 'es',
},
plugins: [
compiler(),
],
}
If your Rollup configuration outputs an IIFE format bundle with a specified name, this plugin will add an extern to ensure the name does not get mangled. Note: This is overrideable via passed flags and options.
// rollup.config.js
import compiler from '@ampproject/rollup-plugin-closure-compiler';
export default {
input: 'main.js',
output: {
file: 'bundle.js',
format: 'iife',
name: 'MyAwesomeThing'
},
plugins: [
compiler(),
],
}
The AMP Project accepts responsible security disclosures through the Google Application Security program.
The AMP Project strives for a positive and growing project community that provides a safe environment for everyone. All members, committers and volunteers in the community are required to act according to the code of conduct.
rollup-plugin-closure-compiler is licensed under the Apache License, Version 2.0.
FAQs
Rollup + Google Closure Compiler
The npm package @ampproject/rollup-plugin-closure-compiler receives a total of 1,517 weekly downloads. As such, @ampproject/rollup-plugin-closure-compiler popularity was classified as popular.
We found that @ampproject/rollup-plugin-closure-compiler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 16 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.