Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@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.
npm install @ampproject/rollup-plugin-closure-compiler --save-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 4,678 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.