terser-webpack-plugin
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
cacache | 15.3.0 | 21.46 kB | ISC | prod | 1 3 |
find-cache-dir | 3.3.2 | 3.06 kB | MIT | prod | |
jest-worker | 26.6.2 | 15.07 kB | MIT | prod | |
p-limit | 3.1.0 | 3.19 kB | MIT | prod | |
schema-utils | 2.7.1 | 16.58 kB | MIT | prod | |
serialize-javascript | 5.0.1 | 6.09 kB | BSD-3-Clause | prod | |
source-map | 0.6.1 | 194.96 kB | BSD-3-Clause | prod | |
webpack-sources | 1.4.3 | 9.39 kB | MIT | 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.