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

postcss-modules-extract-imports

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-modules-extract-imports

A CSS Modules transform to extract local aliases for inline imports

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19M
increased by9.2%
Maintainers
4
Weekly downloads
 
Created

What is postcss-modules-extract-imports?

The postcss-modules-extract-imports npm package is a PostCSS plugin that helps in transforming CSS modules by extracting all local imports and creating a mapping for them. It is commonly used in a CSS module system where CSS is composed in a modular and reusable way. This plugin processes CSS files and rewrites import statements so that they can be bundled correctly by a module bundler.

What are postcss-modules-extract-imports's main functionalities?

Extracting local imports

This feature allows the plugin to extract local imports from a CSS file. When a CSS class composes from another, this plugin rewrites the import to ensure that the composed class includes the necessary styles from the imported class.

import postcss from 'postcss';
import extractImports from 'postcss-modules-extract-imports';

const css = `.className { color: green; } .anotherClass { composes: className; }`;

postcss([extractImports()])
  .process(css, { from: undefined })
  .then(result => {
    console.log(result.css);
  });

Other packages similar to postcss-modules-extract-imports

Keywords

FAQs

Package last updated on 03 Apr 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