Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
closure-webpack-plugin
Advanced tools
Closure-Compiler is a full optimizing compiler and transpiler. It offers unmatched optimizations, provides type checking and can easily target transpilation to different versions of ECMASCRIPT.
Note: This plugin is a very early beta and currently uses a custom build of closure-compiler while neccessary changes are integrated back into the main compiler repository. Only the java version of closure-compiler is currently supported.
const ClosureCompilerPlugin = require('closure-webpack-plugin');
new ClosureCompilerPlugin({mode: 'STANDARD'}, {
// compiler flags here
//
// for debuging help, try these:
//
// formatting: 'PRETTY_PRINT'
// debug: true
})
STANDARD
(default) or AGGRESSIVE_BUNDLE
. Controls how the plugin utilizes the compiler.
STANDARD
mode, closure-compiler is used as a direct replacement for other minifiers as well as most Babel transformations.AGGRESSIVE_BUNDLE
mode, the compiler performs additional optimizations of modules to produce a much smaller file, but
is not compatible with all input modules.false
.
In order to decrease build times, this plugin by default only operates on the main compilation.
Plugins such as extract-text-plugin and html-webpack-plugin run as child compilations and
usually do not need transpilation or minification. You can enable this for all child compilations
by setting this option to true
. For specific control, the option can be set to a function which
will be passed a compilation object.function(compilation) { return /html-webpack/.test(compilation.name); }
.The plugin controls several compiler flags. The following flags should not be used in any mode:
In this mode, the compiler rewrites CommonJS modules and hoists require calls. Some modules are not compatible with this type of rewritting. In particular, hoisting will cause the following code to execute out of order:
const foo = require('foo');
addPolyfillToFoo(foo);
const bar = require('bar');
Aggressive Bundle Mode utilizes a custom runtime in which modules within a chunk file are all included in the same scope. This avoids the cost of small modules.
In Aggressive Bundle Mode, a file can only appear in a single output chunk. Use the Commons Chunk Plugin to split duplicated files into a single output chunk.
Don't use babel - closure-compiler is also a transpiler. If you need features not yet supported by closure-compiler, have babel only target those features.
Chad Killingsworth |
Joshua Wiens |
FAQs
Webpack Google Closure Compiler and Closure Library plugin
The npm package closure-webpack-plugin receives a total of 4,379 weekly downloads. As such, closure-webpack-plugin popularity was classified as popular.
We found that closure-webpack-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.