{"name":"minimizer-webpack-plugin","version":"0.0.1","_id":"minimizer-webpack-plugin@0.0.1","maintainers":[{"name":"evilebottnawi","email":"sheo13666q@gmail.com"}],"dist":{"shasum":"357fbc5a3f9d8834e17dcab1ee92b9a8fa815a92","tarball":"http://registry-npm.ywwl.com/minimizer-webpack-plugin/download/minimizer-webpack-plugin-0.0.1.tgz","fileCount":1,"integrity":"sha512-AcmiOStq6da+JREkK9TFpZzECTT9vCWlBKYWgxvJ1b/ooGgunbgTMpoOpu/2k1ia0MTLq6MJGwmoHfp9bg1VLA==","signatures":[{"sig":"MEUCIA9KqHi+VmRoVPXgDsu17JhdMU5FziWZpZWbAZJser95AiEA9N6WQ2qq8yrVs1mH8TYftl71aoLM7BHHms4LJ7pOtzY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63,"size":157,"noattachment":false,"key":"/minimizer-webpack-plugin/-/minimizer-webpack-plugin-0.0.1.tgz"},"gitHead":"e06c5269d55e916ee2629d9af5d812b64b62bec7","_npmUser":{"name":"evilebottnawi","email":"sheo13666q@gmail.com"},"_npmVersion":"11.11.0","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/minimizer-webpack-plugin_0.0.1_1778255762768_0.04061195017798491","host":"s3://npm-registry-packages-npm-production"},"readme":"<div align=\"center\">\n  <a href=\"https://github.com/webpack/webpack\">\n    <img width=\"200\" height=\"200\" src=\"https://webpack.js.org/assets/icon-square-big.svg\">\n  </a>\n</div>\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![tests][tests]][tests-url]\n[![cover][cover]][cover-url]\n[![discussion][discussion]][discussion-url]\n[![size][size]][size-url]\n\n# minimizer-webpack-plugin\n\nThis plugin minifies your assets in a webpack build. It ships with several\nbuilt-in minimizers covering JavaScript, JSON, HTML, and CSS — pick one\nwith the [`minify`](#minify) option and target the right files with\n[`test`](#test).\n\nJavaScript minimizers:\n\n- [`terser`](https://github.com/terser/terser) — `MinimizerPlugin.terserMinify` (default). The same JavaScript-based minifier that webpack uses out of the box; produces small, well-tested output and supports the full set of `extractComments` modes.\n- [`uglify-js`](https://github.com/mishoo/UglifyJS) — `MinimizerPlugin.uglifyJsMinify`. ES5-only minifier, useful when you specifically need UglifyJS-compatible output. Requires `npm install --save-dev uglify-js`.\n- [`@swc/core`](https://github.com/swc-project/swc) — `MinimizerPlugin.swcMinify`. A very fast Rust-based JavaScript/TypeScript minifier. Requires `npm install --save-dev @swc/core`.\n- [`esbuild`](https://github.com/evanw/esbuild) — `MinimizerPlugin.esbuildMinify`. An extremely fast JS bundler/minifier; legal comments are always preserved (no `extractComments` support). Requires `npm install --save-dev esbuild`.\n\nJSON minimizer:\n\n- `JSON.stringify` — `MinimizerPlugin.jsonMinify`. Built in (no extra dependency); supports `space` and `replacer` options.\n\nHTML minimizers:\n\n- [`html-minifier-terser`](https://github.com/terser/html-minifier-terser) — `MinimizerPlugin.htmlMinifierTerser`. The default HTML minimizer. JavaScript-based, no native dependency. Requires `npm install --save-dev html-minifier-terser`.\n- [`@swc/html`](https://github.com/swc-project/swc) — `MinimizerPlugin.swcMinifyHtml` (full HTML documents) and `MinimizerPlugin.swcMinifyHtmlFragment` (HTML fragments, e.g. `<template>` content). Very fast Rust-based platform for the Web. Requires `npm install --save-dev @swc/html`.\n- [`@minify-html/node`](https://github.com/wilsonzlin/minify-html) — `MinimizerPlugin.minifyHtmlNode`. A Rust HTML minifier optimised for speed and effectiveness. Requires `npm install --save-dev @minify-html/node`.\n\nCSS minimizers:\n\n- [`cssnano`](https://cssnano.github.io/cssnano/) — `MinimizerPlugin.cssnanoMinify`. The default CSS minimizer. Built on top of [PostCSS](https://postcss.org/). Requires `npm install --save-dev cssnano postcss`.\n- [`csso`](https://github.com/css/csso) — `MinimizerPlugin.cssoMinify`. A CSS minifier with structural optimisations. Requires `npm install --save-dev csso`.\n- [`clean-css`](https://github.com/clean-css/clean-css) — `MinimizerPlugin.cleanCssMinify`. A widely-used CSS optimiser. Requires `npm install --save-dev clean-css`.\n- [`esbuild`](https://github.com/evanw/esbuild) — `MinimizerPlugin.esbuildMinifyCss`. Very fast CSS minification using esbuild's CSS loader. Requires `npm install --save-dev esbuild`.\n- [`lightningcss`](https://github.com/parcel-bundler/lightningcss) — `MinimizerPlugin.lightningCssMinify`. A Rust-based CSS parser, transformer, and minifier. Requires `npm install --save-dev lightningcss`.\n- [`@swc/css`](https://github.com/swc-project/swc) — `MinimizerPlugin.swcMinifyCss`. A very fast Rust-based CSS minifier. Requires `npm install --save-dev @swc/css`.\n\nAll of the non-default minimizers are declared as **optional** peer\ndependencies — install only the ones you actually use. You can also stack\nmultiple `MinimizerPlugin` instances in the same build to handle different\nfile types with different minimizers (see [Examples](#examples)).\n\n## Getting Started\n\nWebpack v5 comes with the latest `minimizer-webpack-plugin` out of the box.\nIf you are using Webpack v5 or above and wish to customize the options, you will still need to install `minimizer-webpack-plugin`.\nUsing Webpack v4, you have to install `terser-webpack-plugin` v4 (`minimizer-webpack-plugin` is only published for Webpack v5+).\n\nTo begin, you'll need to install `minimizer-webpack-plugin`:\n\n```console\nnpm install minimizer-webpack-plugin --save-dev\n```\n\nor\n\n```console\nyarn add -D minimizer-webpack-plugin\n```\n\nor\n\n```console\npnpm add -D minimizer-webpack-plugin\n```\n\nThen add the plugin to your `webpack` configuration. For example:\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [new MinimizerPlugin()],\n  },\n};\n```\n\nFinally, run `webpack` using the method you normally use (e.g., via CLI or an npm script).\n\n## Note about source maps\n\n**Works only with `source-map`, `inline-source-map`, `hidden-source-map` and `nosources-source-map` values for the [`devtool`](https://webpack.js.org/configuration/devtool/) option.**\n\nWhy?\n\n- `eval` wraps modules in `eval(\"string\")` and the minimizer does not handle strings.\n- `cheap` has no column information and the minimizer generates only a single line, which leaves only a single mapping.\n\nUsing supported `devtool` values enable source map generation.\n\n## Options\n\n- **[`test`](#test)**\n- **[`include`](#include)**\n- **[`exclude`](#exclude)**\n- **[`parallel`](#parallel)**\n- **[`minify`](#minify)**\n- **[`minimizerOptions`](#minimizeroptions)**\n- **[`extractComments`](#extractcomments)**\n\n### `test`\n\nType:\n\n```ts\ntype test = string | RegExp | (string | RegExp)[];\n```\n\nDefault: `/\\.m?js(\\?.*)?$/i`\n\nTest to match files against.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        test: /\\.js(\\?.*)?$/i,\n      }),\n    ],\n  },\n};\n```\n\n### `include`\n\nType:\n\n```ts\ntype include = string | RegExp | (string | RegExp)[];\n```\n\nDefault: `undefined`\n\nFiles to include.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        include: /\\/includes/,\n      }),\n    ],\n  },\n};\n```\n\n### `exclude`\n\nType:\n\n```ts\ntype exclude = string | RegExp | (string | RegExp)[];\n```\n\nDefault: `undefined`\n\nFiles to exclude.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        exclude: /\\/excludes/,\n      }),\n    ],\n  },\n};\n```\n\n### `parallel`\n\nType:\n\n```ts\ntype parallel = boolean | number;\n```\n\nDefault: `true`\n\nUse multi-process parallel running to improve the build speed.\n\nDefault number of concurrent runs: `os.cpus().length - 1` or `os.availableParallelism() - 1` (if this function is supported).\n\n> **Note**\n>\n> Parallelization can speedup your build significantly and is therefore **highly recommended**.\n\n> **Warning**\n>\n> If you use **Circle CI** or any other environment that doesn't provide the real available count of CPUs then you need to explicitly set up the number of CPUs to avoid `Error: Call retries were exceeded` (see [#143](https://github.com/webpack/minimizer-webpack-plugin/issues/143), [#202](https://github.com/webpack/minimizer-webpack-plugin/issues/202)).\n\n#### `boolean`\n\nEnable/disable multi-process parallel running.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        parallel: true,\n      }),\n    ],\n  },\n};\n```\n\n#### `number`\n\nEnable multi-process parallel running and set number of concurrent runs.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        parallel: 4,\n      }),\n    ],\n  },\n};\n```\n\n### `minify`\n\nType:\n\n```ts\ntype minifyFn = (\n  input: Record<string, string>,\n  sourceMap: import(\"@jridgewell/trace-mapping\").SourceMapInput | undefined,\n  minifyOptions: {\n    module?: boolean | undefined;\n    ecma?: import(\"terser\").ECMA | undefined;\n  },\n  extractComments:\n    | boolean\n    | \"all\"\n    | \"some\"\n    | RegExp\n    | ((\n        astNode: any,\n        comment: {\n          value: string;\n          type: \"comment1\" | \"comment2\" | \"comment3\" | \"comment4\";\n          pos: number;\n          line: number;\n          col: number;\n        },\n      ) => boolean)\n    | {\n        condition?:\n          | boolean\n          | \"all\"\n          | \"some\"\n          | RegExp\n          | ((\n              astNode: any,\n              comment: {\n                value: string;\n                type: \"comment1\" | \"comment2\" | \"comment3\" | \"comment4\";\n                pos: number;\n                line: number;\n                col: number;\n              },\n            ) => boolean)\n          | undefined;\n        filename?: string | ((fileData: any) => string) | undefined;\n        banner?:\n          string | boolean | ((commentsFile: string) => string) | undefined;\n      }\n    | undefined,\n) => Promise<{\n  code: string;\n  map?: import(\"@jridgewell/trace-mapping\").SourceMapInput | undefined;\n  errors?: (string | Error)[] | undefined;\n  warnings?: (string | Error)[] | undefined;\n  extractedComments?: string[] | undefined;\n}>;\n\ntype minify = minifyFn | minifyFn[];\n```\n\nDefault: `MinimizerPlugin.terserMinify`\n\nAllows you to override the default minify function.\nBy default plugin uses [terser](https://github.com/terser/terser) package.\nUseful for using and testing unpublished versions or forks.\n\nAn array of functions can also be provided. Each minimizer can expose a\n`filter(name, info)` helper that decides whether it should run on a given\nasset; the plugin dispatches each asset only to the minimizers whose `filter`\naccepts it (or runs them all when no filter is set). All built-in minimizers\nship with a `filter` that matches their natural extension, so a single plugin\ninstance and a single worker pool can handle JS, CSS, HTML and JSON together\nwithout juggling multiple `MinimizerPlugin` instances — just widen `test` to\nlet those asset types reach the dispatcher:\n\n```js\nnew MinimizerPlugin({\n  test: /\\.(?:[cm]?js|css|html?|json)(\\?.*)?$/i,\n  minify: [\n    MinimizerPlugin.terserMinify,\n    MinimizerPlugin.cssnanoMinify,\n    MinimizerPlugin.htmlMinifierTerser,\n    MinimizerPlugin.jsonMinify,\n  ],\n});\n```\n\nWhen more than one minimizer in the array claims the same asset, the chain\nsemantic still applies: the output of each accepting minimizer is fed as\ninput to the next. The [`minimizerOptions`](#minimizeroptions) option may\nbe an array (index-paired with `minify`) or a single object reused by every\nminimizer.\n\nThe `test` option always defaults to `/\\.[cm]?js(\\?.*)?$/i`. When you mix\nasset types in a single plugin instance, widen `test` so non-JS assets reach\nthe dispatcher (for example `test: /\\.(?:[cm]?js|css|html?|json)(\\?.*)?$/i`).\n\n> **Warning**\n>\n> **Always use `require` inside `minify` function when `parallel` option enabled**.\n\n#### `function`\n\n**webpack.config.js**\n\n```js\n// Can be async\nconst minify = (input, sourceMap, minimizerOptions, extractsComments) => {\n  // The `minimizerOptions` argument contains options from the `minimizerOptions` plugin option\n  // You can use `minimizerOptions.myCustomOption`\n\n  // Custom logic for extract comments\n  const { map, code } = require(\"uglify-module\") // Or require('./path/to/uglify-module')\n    .minify(input, {/* Your options for minification */});\n\n  return { map, code, warnings: [], errors: [], extractedComments: [] };\n};\n\n// Used to regenerate `fullhash`/`chunkhash` between different implementation\n// Example: you fix a bug in custom minimizer/custom function, but unfortunately webpack doesn't know about it, so you will get the same fullhash/chunkhash\n// to avoid this you can provide version of your custom minimizer\n// You don't need if you use only `contenthash`\nminify.getMinimizerVersion = () => {\n  let packageJson;\n\n  try {\n    packageJson = require(\"uglify-module/package.json\");\n  } catch (error) {\n    // Ignore\n  }\n\n  return packageJson && packageJson.version;\n};\n\n// Restrict the minimizer to the assets it can actually handle. The plugin\n// skips assets for which `filter` returns `false` and (when an array of\n// minimizers is used) dispatches each asset only to the minimizers that\n// accept it. Returning `undefined` is treated as accept.\nminify.filter = (name) => /\\.[cm]?js(\\?.*)?$/i.test(name);\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minimizerOptions: {\n          myCustomOption: true,\n        },\n        minify,\n      }),\n    ],\n  },\n};\n```\n\n#### `array`\n\nIf an array of functions is passed to the `minify` option, each asset is\ndispatched to the minimizers whose `filter` accepts it. When more than one\nminimizer accepts the same asset the output of each is fed as input to the\nnext one (the chain semantic). The `minimizerOptions` option can be either an\narray of option objects (index-paired with `minify`) or a single object that\nwill be shared by all minimizers. Warnings, errors and extracted comments\nfrom all running minimizers are merged together.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minify: [MinimizerPlugin.terserMinify, MinimizerPlugin.swcMinify],\n        // `minimizerOptions` can be an array of options, one per `minify` entry\n        minimizerOptions: [\n          // Options for `MinimizerPlugin.terserMinify`\n          { mangle: false },\n          // Options for `MinimizerPlugin.swcMinify`\n          {},\n        ],\n      }),\n    ],\n  },\n};\n```\n\nA single plugin instance can also handle multiple asset types — the built-in\nminimizers each ship with a `filter` matching their natural extension, so JS,\nCSS, HTML and JSON can all be minified by one shared worker pool:\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        // `test` still defaults to JS only, so widen it to catch every\n        // asset type you want the dispatcher to consider.\n        test: /\\.(?:[cm]?js|css|html?|json)(\\?.*)?$/i,\n        minify: [\n          MinimizerPlugin.terserMinify,\n          MinimizerPlugin.cssnanoMinify,\n          MinimizerPlugin.htmlMinifierTerser,\n          MinimizerPlugin.jsonMinify,\n        ],\n      }),\n    ],\n  },\n};\n```\n\n### `minimizerOptions`\n\nType:\n\n```ts\ninterface minimizerOptions {\n  compress?: boolean | CompressOptions;\n  ecma?: ECMA;\n  enclose?: boolean | string;\n  ie8?: boolean;\n  keep_classnames?: boolean | RegExp;\n  keep_fnames?: boolean | RegExp;\n  mangle?: boolean | MangleOptions;\n  module?: boolean;\n  nameCache?: object;\n  format?: FormatOptions;\n  /** @deprecated */\n  output?: FormatOptions;\n  parse?: ParseOptions;\n  safari10?: boolean;\n  sourceMap?: boolean | SourceMapOptions;\n  toplevel?: boolean;\n}\n\ntype options = minimizerOptions | minimizerOptions[];\n```\n\nDefault: [default](https://github.com/terser/terser#minify-options)\n\nOptions for the active minimizer. With the default Terser minify, see Terser's\n[minify options](https://github.com/terser/terser#minify-options).\n\nWhen the [`minify`](#minify) option is an array of minimizers, `minimizerOptions`\ncan also be an array. Each element is passed to the minimizer at the same\nindex in the `minify` array. If a single object is provided instead, it is\nreused for every minimizer.\n\n> **Note**\n>\n> `terserOptions` is kept as a deprecated alias of `minimizerOptions` for\n> backwards compatibility — passing either is equivalent. If both are set,\n> `minimizerOptions` wins. Prefer `minimizerOptions` in new code.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minimizerOptions: {\n          ecma: undefined,\n          parse: {},\n          compress: {},\n          mangle: true, // Note `mangle.properties` is `false` by default.\n          module: false,\n          // Deprecated\n          output: null,\n          format: null,\n          toplevel: false,\n          nameCache: null,\n          ie8: false,\n          keep_classnames: undefined,\n          keep_fnames: false,\n          safari10: false,\n        },\n      }),\n    ],\n  },\n};\n```\n\n### `extractComments`\n\nType:\n\n```ts\ntype extractComments =\n  | boolean\n  | string\n  | RegExp\n  | ((\n      astNode: any,\n      comment: {\n        value: string;\n        type: \"comment1\" | \"comment2\" | \"comment3\" | \"comment4\";\n        pos: number;\n        line: number;\n        col: number;\n      },\n    ) => boolean)\n  | {\n      condition?:\n        | boolean\n        | \"all\"\n        | \"some\"\n        | RegExp\n        | ((\n            astNode: any,\n            comment: {\n              value: string;\n              type: \"comment1\" | \"comment2\" | \"comment3\" | \"comment4\";\n              pos: number;\n              line: number;\n              col: number;\n            },\n          ) => boolean)\n        | undefined;\n      filename?: string | ((fileData: any) => string) | undefined;\n      banner?:\n        string | boolean | ((commentsFile: string) => string) | undefined;\n    };\n```\n\nDefault: `true`\n\nWhether comments shall be extracted to a separate file, (see [details](https://github.com/webpack/webpack/commit/71933e979e51c533b432658d5e37917f9e71595a)).\n\nBy default, extract only comments using `/^\\**!|@preserve|@license|@cc_on/i` RegExp condition and remove remaining comments.\n\nIf the original file is named `foo.js`, then the comments will be stored to `foo.js.LICENSE.txt`.\n\nThe `minimizerOptions.format.comments` option specifies whether the comment will be preserved - i.e., it is possible to preserve some comments (e.g. annotations) while extracting others, or even preserve comments that have already been extracted.\n\n#### `boolean`\n\nEnable/disable extracting comments.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        extractComments: true,\n      }),\n    ],\n  },\n};\n```\n\n#### `string`\n\nExtract `all` or `some` (use the `/^\\**!|@preserve|@license|@cc_on/i` RegExp) comments.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        extractComments: \"all\",\n      }),\n    ],\n  },\n};\n```\n\n#### `RegExp`\n\nAll comments that match the given expression will be extracted to a separate file.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        extractComments: /@extract/i,\n      }),\n    ],\n  },\n};\n```\n\n#### `function`\n\nAll comments that match the given expression will be extracted to a separate file.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        extractComments: (astNode, comment) => {\n          if (/@extract/i.test(comment.value)) {\n            return true;\n          }\n\n          return false;\n        },\n      }),\n    ],\n  },\n};\n```\n\n#### `object`\n\nAllows you to customize condition for extracting comments, and specify the extracted file name and banner.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        extractComments: {\n          condition: /^\\**!|@preserve|@license|@cc_on/i,\n          filename: (fileData) =>\n            // The \"fileData\" argument contains object with \"filename\", \"basename\", \"query\" and \"hash\"\n            `${fileData.filename}.LICENSE.txt${fileData.query}`,\n          banner: (licenseFile) =>\n            `License information can be found in ${licenseFile}`,\n        },\n      }),\n    ],\n  },\n};\n```\n\n##### `condition`\n\nType:\n\n```ts\ntype condition =\n  | boolean\n  | \"all\"\n  | \"some\"\n  | RegExp\n  | ((\n      astNode: any,\n      comment: {\n        value: string;\n        type: \"comment1\" | \"comment2\" | \"comment3\" | \"comment4\";\n        pos: number;\n        line: number;\n        col: number;\n      },\n    ) => boolean)\n  | undefined;\n```\n\nThe condition that determines which comments should be extracted.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        extractComments: {\n          condition: \"some\",\n          filename: (fileData) =>\n            // The \"fileData\" argument contains object with \"filename\", \"basename\", \"query\" and \"hash\"\n            `${fileData.filename}.LICENSE.txt${fileData.query}`,\n          banner: (licenseFile) =>\n            `License information can be found in ${licenseFile}`,\n        },\n      }),\n    ],\n  },\n};\n```\n\n##### `filename`\n\nType:\n\n```ts\ntype filename = string | ((fileData: any) => string) | undefined;\n```\n\nDefault: `[file].LICENSE.txt[query]`\n\nAvailable placeholders: `[file]`, `[query]` and `[filebase]` (`[base]` for webpack 5).\n\nThe file where the extracted comments will be stored.\n\nDefault is to append the suffix `.LICENSE.txt` to the original filename.\n\n> **Warning**\n>\n> We highly recommend using the `.txt` extension. Using `.js`/`.cjs`/`.mjs` extensions may conflict with existing assets, which leads to broken code.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        extractComments: {\n          condition: /^\\**!|@preserve|@license|@cc_on/i,\n          filename: \"extracted-comments.js\",\n          banner: (licenseFile) =>\n            `License information can be found in ${licenseFile}`,\n        },\n      }),\n    ],\n  },\n};\n```\n\n##### `banner`\n\nType:\n\n```ts\ntype banner = string | boolean | ((commentsFile: string) => string) | undefined;\n```\n\nDefault: `/*! For license information please see ${commentsFile} */`\n\nThe banner text that points to the extracted file and will be added at the top of the original file.\n\nIt can be `false` (no banner), a `String`, or a `function<(string) -> String>` that will be called with the filename where the extracted comments have been stored.\n\nThe banner will be wrapped in a comment.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        extractComments: {\n          condition: true,\n          filename: (fileData) =>\n            // The \"fileData\" argument contains object with \"filename\", \"basename\", \"query\" and \"hash\"\n            `${fileData.filename}.LICENSE.txt${fileData.query}`,\n          banner: (commentsFile) =>\n            `My custom banner about license information ${commentsFile}`,\n        },\n      }),\n    ],\n  },\n};\n```\n\n## Embedded source\n\nSource written in one language that reaches the bundle inside another is\nminified too, which no asset carries and an asset-level minimizer therefore\nnever sees. It needs no option (webpack `>= 5.110.0`; older versions reach only\nwhat an asset nests inside itself).\n\nSuch source has no filename, so `test` / `include` / `exclude` and each\nminimizer's `filter` — all of which match filenames — cannot dispatch it.\n**It is dispatched by the language it is written in**, which every minify\nfunction states for itself:\n\n```js\nmyCssMinifier.getTypes = () => [\"css\"];\n```\n\nThe built-ins declare `javascript` (`terserMinify`, `uglifyJsMinify`,\n`swcMinify`, `esbuildMinify`), `css` (`cssnanoMinify`, `cssoMinify`,\n`cleanCssMinify`, `esbuildMinifyCss`, `lightningCssMinify`, `swcMinifyCss`),\n`html` (`htmlMinifierTerser`, `swcMinifyHtml`, `swcMinifyHtmlFragment`,\n`minifyHtmlNode`) and `json` (`jsonMinify`); webpack's own `cssMinify` and\n`htmlMinify` declare `css` and `html`. A language **no configured minimizer\nclaims — `svg` out of the box — is emitted exactly as it was written**, and a\ncustom minify function without `getTypes` is never handed embedded source at\nall.\n\nWhat this reaches:\n\n- CSS and HTML a module embeds in a JavaScript string literal (every\n  `exportType` but `link`).\n- The text an `asset/source` module embeds, and the payload an `asset/inline`\n  module encodes — the payload before it is encoded, so the encoding covers\n  what came back.\n- What a document or a stylesheet nests inside itself: an inline `<style>`,\n  every `style=\"\"`, a `<script>` holding JavaScript or JSON, an `<svg>` subtree,\n  the document an `<iframe srcdoc>` holds, and the payload of a `url()` `data:`\n  URL. This is how an inline `<script>` is minified by `terser` at all.\n\nA `style=\"\"` arrives as **`css` with `as: \"block-contents\"`** — the same word\n`module.parser.css.as` uses. It holds a block's contents rather than a whole\nstylesheet, so a minifier claiming `css` is handed one either way and `as` says\nwhich it is. Ignore it at your peril: parsing a declaration list as a stylesheet\nfinds no rule and returns nothing.\n\nThe nested case needs a minifier that can hand its nested bodies out, which it\nalso states for itself — webpack's `cssMinify` and `htmlMinify` do:\n\n```js\n// The languages this minifier can offer, given the options it will run with.\nmyHtmlMinifier.getEmbeddedTypes = (minimizerOptions) => [\"css\", \"javascript\"];\n```\n\nThe option is passed only when **the two declarations meet**: if nothing\nconfigured claims a language this minifier could offer, it is never handed one,\nand minification is exactly what it always was. When it is, the nested bodies\nare reached **in the same parse that prints** — the minifier leaves a marker\nwhere each one goes and the answers are put in their place, so nothing is parsed\ntwice.\n\n> **Note**\n>\n> Source a module embeds in JavaScript is minified during code generation,\n> before the worker pool is up, so [`parallel`](#parallel) does not apply to it.\n> What an asset nests inside itself is minified in the pool with the asset.\n\n## Examples\n\n### Preserve Comments\n\nExtract all legal comments (i.e. `/^\\**!|@preserve|@license|@cc_on/i`) and preserve `/@license/i` comments.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minimizerOptions: {\n          format: {\n            comments: /@license/i,\n          },\n        },\n        extractComments: true,\n      }),\n    ],\n  },\n};\n```\n\n### Remove Comments\n\nIf you want to build without comments, use this config:\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minimizerOptions: {\n          format: {\n            comments: false,\n          },\n        },\n        extractComments: false,\n      }),\n    ],\n  },\n};\n```\n\n### [`uglify-js`](https://github.com/mishoo/UglifyJS)\n\n[`UglifyJS`](https://github.com/mishoo/UglifyJS) is a JavaScript parser, minifier, compressor and beautifier toolkit.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minify: MinimizerPlugin.uglifyJsMinify,\n        // `minimizerOptions` will be passed to `uglify-js`\n        // Link to options - https://github.com/mishoo/UglifyJS#minify-options\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n### [`swc`](https://github.com/swc-project/swc)\n\n[`swc`](https://github.com/swc-project/swc) is a super-fast compiler written in `Rust`, producing widely supported JavaScript from modern standards and TypeScript.\n\n> **Warning**\n>\n> `extractComments` is supported with `@swc/core >= 1.15.30`.\n> Only serializable extract conditions are supported: booleans, `\"some\"`, `\"all\"`, string patterns, `RegExp` values without flags, or object conditions that resolve to those forms.\n> Function conditions and flagged regular expressions are not supported.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minify: MinimizerPlugin.swcMinify,\n        // `minimizerOptions` will be passed to `swc` (`@swc/core`)\n        // Link to options - https://swc.rs/docs/config-js-minify\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n### [`esbuild`](https://github.com/evanw/esbuild)\n\n[`esbuild`](https://github.com/evanw/esbuild) is an extremely fast JavaScript bundler and minifier.\n\n> **Warning**\n>\n> The `extractComments` option is not supported, and all legal comments (i.e. copyright, licenses and etc) will be preserved.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minify: MinimizerPlugin.esbuildMinify,\n        // `minimizerOptions` will be passed to `esbuild`\n        // Link to options - https://esbuild.github.io/api/#minify\n        // Note: the `minify` options is true by default (and override other `minify*` options), so if you want to disable the `minifyIdentifiers` option (or other `minify*` options) please use:\n        // minimizerOptions: {\n        //   minify: false,\n        //   minifyWhitespace: true,\n        //   minifyIdentifiers: false,\n        //   minifySyntax: true,\n        // },\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n### JSON\n\nUses `JSON.stringify()` to minify your JSON files during the build process.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      // Keeps original terser plugin to minify JS files\n      \"...\",\n      // Will minify JSON files (they can come from copy-webpack-plugin or when you are using asset modules)\n      new MinimizerPlugin({\n        test: /\\.json$/,\n        minify: MinimizerPlugin.jsonMinify,\n        // We are supporting `space` and `replacer` options, you can set them below\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n### HTML\n\nThe plugin can minify HTML assets too. Pick one of the bundled HTML\nminimizers and set `test` to match your HTML files.\n\nAvailable HTML minimizers:\n\n- `MinimizerPlugin.htmlMinifierTerser` — uses [`html-minifier-terser`](https://github.com/terser/html-minifier-terser).\n- `MinimizerPlugin.swcMinifyHtml` — uses [`@swc/html`](https://github.com/swc-project/swc) for full HTML documents (with doctype and `<html>`/`<head>`/`<body>` tags).\n- `MinimizerPlugin.swcMinifyHtmlFragment` — uses [`@swc/html`](https://github.com/swc-project/swc) for HTML fragments (e.g. content inside `<template></template>` or partial HTML strings).\n- `MinimizerPlugin.minifyHtmlNode` — uses [`@minify-html/node`](https://github.com/wilsonzlin/minify-html).\n\nThe HTML minimizers are optional peer dependencies — install only the one\nyou actually use:\n\n```console\nnpm install --save-dev html-minifier-terser\n# or\nnpm install --save-dev @swc/html\n# or\nnpm install --save-dev @minify-html/node\n```\n\n> **Note**\n>\n> HTML assets typically come from plugins like\n> [`copy-webpack-plugin`](https://github.com/webpack-contrib/copy-webpack-plugin),\n> [`html-webpack-plugin`](https://github.com/jantimon/html-webpack-plugin),\n> or webpack's [asset modules](https://webpack.js.org/guides/asset-modules/).\n\n> **Note**\n>\n> Whitespace handling differs between tools (defaults):\n>\n> - `@swc/html` — removes/collapses whitespace only in safe places (around `html`/`body`, inside `<head>`, between `<meta>`/`<script>`/`<link>` etc.).\n> - `html-minifier-terser` — always collapses multiple whitespaces to a single space (never removes entirely); configurable via [its options](https://github.com/terser/html-minifier-terser#options-quick-reference).\n> - `@minify-html/node` — see [its whitespace docs](https://github.com/wilsonzlin/minify-html#whitespace).\n\n#### `html-minifier-terser`\n\n[`html-minifier-terser`](https://github.com/terser/html-minifier-terser) is a JavaScript-based HTML minifier with no native dependency. It's the default HTML minimizer.\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      // Keeps the default Terser plugin for JS files\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.html(\\?.*)?$/i,\n        minify: MinimizerPlugin.htmlMinifierTerser,\n        // Options - https://github.com/terser/html-minifier-terser#options-quick-reference\n        minimizerOptions: {\n          collapseWhitespace: true,\n          removeComments: true,\n        },\n      }),\n    ],\n  },\n};\n```\n\n#### `@swc/html` — HTML documents\n\nUse `swcMinifyHtml` for complete HTML documents (i.e. with a doctype and `<html>`/`<head>`/`<body>` tags).\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.html(\\?.*)?$/i,\n        minify: MinimizerPlugin.swcMinifyHtml,\n        // Options - https://github.com/swc-project/bindings/blob/main/packages/html/index.ts\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n#### `@swc/html` — HTML fragments\n\nUse `swcMinifyHtmlFragment` for partial HTML — for example, content of `<template></template>` tags or HTML strings that get injected into another document.\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.template\\.html$/i,\n        minify: MinimizerPlugin.swcMinifyHtmlFragment,\n        // Options - https://github.com/swc-project/bindings/blob/main/packages/html/index.ts\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n> **Note**\n>\n> The difference between `swcMinifyHtml` and `swcMinifyHtmlFragment` is the\n> error reporting — invalid or broken syntax is reported at build time.\n\n#### `@minify-html/node`\n\n[`@minify-html/node`](https://github.com/wilsonzlin/minify-html) is a Rust HTML minifier.\n\n**webpack.config.js**\n\n```js\nconst Minimizer = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      \"...\",\n      new Minimizer({\n        test: /\\.html(\\?.*)?$/i,\n        minify: Minimizer.minifyHtmlNode,\n        // Options - https://github.com/wilsonzlin/minify-html#minification\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\nYou can also stack multiple `MinimizerPlugin` instances to compress different files with different `minify` functions in the same build (e.g. JS with `terserMinify`, HTML with `htmlMinifierTerser`, JSON with `jsonMinify`).\n\n### CSS\n\nThe plugin can minify CSS assets too. Pick one of the bundled CSS\nminimizers and set `test` to match your CSS files.\n\nAvailable CSS minimizers:\n\n- `MinimizerPlugin.cssnanoMinify` — uses [`cssnano`](https://cssnano.github.io/cssnano/) (via [`postcss`](https://postcss.org/)).\n- `MinimizerPlugin.cssoMinify` — uses [`csso`](https://github.com/css/csso).\n- `MinimizerPlugin.cleanCssMinify` — uses [`clean-css`](https://github.com/clean-css/clean-css).\n- `MinimizerPlugin.esbuildMinifyCss` — uses [`esbuild`](https://github.com/evanw/esbuild) with the CSS loader.\n- `MinimizerPlugin.lightningCssMinify` — uses [`lightningcss`](https://github.com/parcel-bundler/lightningcss).\n- `MinimizerPlugin.swcMinifyCss` — uses [`@swc/css`](https://github.com/swc-project/swc).\n\nThe CSS minimizers are optional peer dependencies — install only the ones\nyou actually use:\n\n```console\nnpm install --save-dev cssnano postcss\n# or\nnpm install --save-dev csso\n# or\nnpm install --save-dev clean-css\n# or\nnpm install --save-dev esbuild\n# or\nnpm install --save-dev lightningcss\n# or\nnpm install --save-dev @swc/css\n```\n\n> **Note**\n>\n> CSS assets typically come from plugins like\n> [`mini-css-extract-plugin`](https://github.com/webpack-contrib/mini-css-extract-plugin)\n> or webpack's [asset modules](https://webpack.js.org/guides/asset-modules/).\n\n#### `cssnano`\n\n[`cssnano`](https://cssnano.github.io/cssnano/) is the default CSS minimizer. It runs as a [PostCSS](https://postcss.org/) plugin.\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      // Keeps the default Terser plugin for JS files\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.cssnanoMinify,\n        // Options - https://cssnano.github.io/cssnano/docs/config-file/\n        minimizerOptions: {\n          preset: \"default\",\n        },\n      }),\n    ],\n  },\n};\n```\n\n#### `csso`\n\n[`csso`](https://github.com/css/csso) is a CSS minifier with structural optimisations.\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.cssoMinify,\n        // Options - https://github.com/css/csso#minifysource-options\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n#### `clean-css`\n\n[`clean-css`](https://github.com/clean-css/clean-css) is a widely-used CSS optimiser.\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.cleanCssMinify,\n        // Options - https://github.com/clean-css/clean-css#constructor-options\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n#### `esbuild`\n\n[`esbuild`](https://github.com/evanw/esbuild) ships with a fast CSS minifier (used via its CSS loader).\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.esbuildMinifyCss,\n        // Options - https://esbuild.github.io/api/#transform-api\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n#### `lightningcss`\n\n[`lightningcss`](https://github.com/parcel-bundler/lightningcss) is a Rust-based CSS parser, transformer, and minifier.\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.lightningCssMinify,\n        // Options - https://lightningcss.dev/transpilation.html\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n#### `@swc/css`\n\n[`@swc/css`](https://github.com/swc-project/swc) is a Rust-based CSS minifier.\n\n**webpack.config.js**\n\n```js\nconst MinimizerPlugin = require(\"minimizer-webpack-plugin\");\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      \"...\",\n      new MinimizerPlugin({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.swcMinifyCss,\n        // Options - https://github.com/swc-project/bindings/blob/main/packages/css/index.ts\n        minimizerOptions: {},\n      }),\n    ],\n  },\n};\n```\n\n### Custom Minify Function\n\nOverride the default minify function - use `uglify-js` for minification.\n\n**webpack.config.js**\n\n```js\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minify: (file, sourceMap) => {\n          // https://github.com/mishoo/UglifyJS2#minify-options\n          const uglifyJsOptions = {/* your `uglify-js` package options */};\n\n          if (sourceMap) {\n            uglifyJsOptions.sourceMap = {\n              content: sourceMap,\n            };\n          }\n\n          return require(\"uglify-js\").minify(file, uglifyJsOptions);\n        },\n      }),\n    ],\n  },\n};\n```\n\n### Typescript\n\nWith default Terser minify function:\n\n```ts\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin({\n        minimizerOptions: {\n          compress: true,\n        },\n      }),\n    ],\n  },\n};\n```\n\nWith built-in minify functions:\n\n```ts\nimport { type JsMinifyOptions as SwcOptions } from \"@swc/core\";\nimport { type MinifyOptions as SwcCssOptions } from \"@swc/css\";\nimport {\n  type FragmentOptions as SwcHtmlFragmentOptions,\n  type Options as SwcHtmlOptions,\n} from \"@swc/html\";\nimport { type OptionsOutput as CleanCssOptions } from \"clean-css\";\nimport { type Options as CssnanoOptions } from \"cssnano\";\nimport { type CompressOptions as CssoOptions } from \"csso\";\nimport { type TransformOptions as EsbuildOptions } from \"esbuild\";\nimport { type Options as HtmlMinifierTerserOptions } from \"html-minifier-terser\";\nimport { type TransformOptions as LightningCssOptions } from \"lightningcss\";\nimport { type MinifyOptions as TerserOptions } from \"terser\";\nimport { type MinifyOptions as UglifyJSOptions } from \"uglify-js\";\n\nmodule.exports = {\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new MinimizerPlugin<SwcOptions>({\n        minify: MinimizerPlugin.swcMinify,\n        minimizerOptions: {\n          // `swc` options\n        },\n      }),\n      new MinimizerPlugin<UglifyJSOptions>({\n        minify: MinimizerPlugin.uglifyJsMinify,\n        minimizerOptions: {\n          // `uglif-js` options\n        },\n      }),\n      new MinimizerPlugin<EsbuildOptions>({\n        minify: MinimizerPlugin.esbuildMinify,\n        minimizerOptions: {\n          // `esbuild` options\n        },\n      }),\n\n      // Alternative usage:\n      new MinimizerPlugin<TerserOptions>({\n        minify: MinimizerPlugin.terserMinify,\n        minimizerOptions: {\n          // `terser` options\n        },\n      }),\n\n      // HTML minimizers\n      new MinimizerPlugin<HtmlMinifierTerserOptions>({\n        test: /\\.html(\\?.*)?$/i,\n        minify: MinimizerPlugin.htmlMinifierTerser,\n        minimizerOptions: {\n          // `html-minifier-terser` options\n        },\n      }),\n      new MinimizerPlugin<SwcHtmlOptions>({\n        test: /\\.html(\\?.*)?$/i,\n        minify: MinimizerPlugin.swcMinifyHtml,\n        minimizerOptions: {\n          // `@swc/html` options\n        },\n      }),\n      new MinimizerPlugin<SwcHtmlFragmentOptions>({\n        test: /\\.template\\.html$/i,\n        minify: MinimizerPlugin.swcMinifyHtmlFragment,\n        minimizerOptions: {\n          // `@swc/html` fragment options\n        },\n      }),\n\n      // CSS minimizers\n      new MinimizerPlugin<CssnanoOptions>({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.cssnanoMinify,\n        minimizerOptions: {\n          // `cssnano` options\n        },\n      }),\n      new MinimizerPlugin<CssoOptions>({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.cssoMinify,\n        minimizerOptions: {\n          // `csso` options\n        },\n      }),\n      new MinimizerPlugin<CleanCssOptions>({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.cleanCssMinify,\n        minimizerOptions: {\n          // `clean-css` options\n        },\n      }),\n      new MinimizerPlugin<EsbuildOptions>({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.esbuildMinifyCss,\n        minimizerOptions: {\n          // `esbuild` options (CSS loader)\n        },\n      }),\n      new MinimizerPlugin<LightningCssOptions>({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.lightningCssMinify,\n        minimizerOptions: {\n          // `lightningcss` options\n        },\n      }),\n      new MinimizerPlugin<SwcCssOptions>({\n        test: /\\.css(\\?.*)?$/i,\n        minify: MinimizerPlugin.swcMinifyCss,\n        minimizerOptions: {\n          // `@swc/css` options\n        },\n      }),\n    ],\n  },\n};\n```\n\n## Contributing\n\nWe welcome all contributions!\nIf you're new here, please take a moment to review our contributing guidelines before submitting issues or pull requests.\n\n[CONTRIBUTING](https://github.com/webpack/minimizer-webpack-plugin?tab=contributing-ov-file#contributing)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm]: https://img.shields.io/npm/v/minimizer-webpack-plugin.svg\n[npm-url]: https://npmjs.com/package/minimizer-webpack-plugin\n[node]: https://img.shields.io/node/v/minimizer-webpack-plugin.svg\n[node-url]: https://nodejs.org\n[tests]: https://github.com/webpack/minimizer-webpack-plugin/workflows/minimizer-webpack-plugin/badge.svg\n[tests-url]: https://github.com/webpack/minimizer-webpack-plugin/actions\n[cover]: https://codecov.io/gh/webpack/minimizer-webpack-plugin/branch/main/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack/minimizer-webpack-plugin\n[discussion]: https://img.shields.io/github/discussions/webpack/webpack\n[discussion-url]: https://github.com/webpack/webpack/discussions\n[size]: https://packagephobia.now.sh/badge?p=minimizer-webpack-plugin\n[size-url]: https://packagephobia.now.sh/result?p=minimizer-webpack-plugin\n","publish_time":1778255762890,"_cnpm_publish_time":1778255762890,"dist-tags":{"latest":"5.14.0"}}