Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

css-minimizer-webpack-plugin

Package Overview
Dependencies
Maintainers
3
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-minimizer-webpack-plugin

CSS minimizer (minifier) plugin for Webpack

  • 7.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.5M
decreased by-24.04%
Maintainers
3
Weekly downloads
 
Created

What is css-minimizer-webpack-plugin?

The css-minimizer-webpack-plugin is a plugin for webpack that optimizes and minimizes CSS assets. It uses cssnano to optimize CSS by removing comments, whitespace, and other unnecessary characters without affecting the functionality of the CSS code. It can be used in production builds to reduce the size of CSS files, which can lead to faster load times for web applications.

What are css-minimizer-webpack-plugin's main functionalities?

Minification of CSS

This feature allows you to integrate CSS minification into your webpack build process. By adding the CssMinimizerPlugin to the optimization.minimizer array in your webpack configuration, you can ensure that your CSS files are automatically minimized during the build.

{"optimization": {"minimizer": [new CssMinimizerPlugin()]}}

Source Map Generation

This feature enables the generation of source maps for the minimized CSS files. Source maps allow you to trace back the minified CSS to the original source files, which is useful for debugging purposes.

{"optimization": {"minimizer": [new CssMinimizerPlugin({sourceMap: true})]}}

Custom Minification Options

This feature allows you to provide custom options to the cssProcessor used by the plugin. In this example, the cssProcessorOptions are set to use the 'default' preset and configure it to remove all comments from the CSS.

{"optimization": {"minimizer": [new CssMinimizerPlugin({cssProcessorOptions: {preset: ['default', {discardComments: {removeAll: true}}]}})]}}

Other packages similar to css-minimizer-webpack-plugin

Keywords

FAQs

Package last updated on 07 May 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc