terser-webpack-plugin
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
p-limit | 3.1.0 | 3.19 kB | MIT | prod | |
source-map | 0.6.1 | 194.96 kB | BSD-3-Clause | prod |
The terser-webpack-plugin is a JavaScript minimization plugin for webpack. It utilizes terser to minimize your JavaScript code.
To use terser-webpack-plugin, you first need to install it using npm, yarn, or pnpm like this:
npm install terser-webpack-plugin --save-dev
yarn add -D terser-webpack-plugin
pnpm add -D terser-webpack-plugin
Then, include the terser-webpack-plugin in your webpack
config like this:
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
optimization: {
minimize: true,
minimizer: [new TerserPlugin()],
},
};
Finally, run webpack
using the method you prefer. The plugin also supports various configurations such as test
, include
, exclude
, parallel
, minify
, terserOptions
, and extractComments
.
The terser-webpack-plugin documentation is available on GitHub. The documentation provides a detailed explanation of the plugin's installation process, usage, options, and examples. It also furnishes guidelines on how to contribute to the project.