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

postcss-discard-comments

Package Overview
Dependencies
Maintainers
5
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-discard-comments

Discard comments in your CSS files with PostCSS.

  • 4.0.0-nightly.2020.9.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11M
decreased by-2.12%
Maintainers
5
Weekly downloads
 
Created

What is postcss-discard-comments?

The postcss-discard-comments npm package is a PostCSS plugin designed to remove comments from your CSS files. It can be highly useful for reducing the size of CSS files in production environments, improving load times and efficiency. The package offers flexibility in handling comments, allowing users to remove all comments or selectively keep some based on specific criteria.

What are postcss-discard-comments's main functionalities?

Remove all comments

This feature allows you to remove all comments from your CSS files, which can significantly reduce file size and improve loading times for your web pages.

postcss([ require('postcss-discard-comments')() ]).process(YOUR_CSS).then(result => { console.log(result.css); });

Preserve comments with specific patterns

This feature enables you to keep comments that match specific patterns, such as those starting with an exclamation mark (!), which are often used to denote important information or licensing details.

postcss([ require('postcss-discard-comments')({remove: (comment) => !comment.startsWith('!')}) ]).process(YOUR_CSS).then(result => { console.log(result.css); });

Other packages similar to postcss-discard-comments

Keywords

FAQs

Package last updated on 03 Sep 2020

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