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

karma-typescript-cssmodules-transform

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-typescript-cssmodules-transform

PostCSS runner plugin for CSS Modules

  • 5.5.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-88.89%
Maintainers
2
Weekly downloads
 
Created
Source

karma-typescript-cssmodules-transform

Npm Version Travis Status Appveyor Status

Karma-Typescript :heart: CSS Modules

This plugin is a specialized PostCSS runner, which transforms CSS :exports blocks to JSON on the fly when running tests with karma-typescript.

The CSS Modules specification is implemented by running PostCSS with these plugins:

Installation

$ npm install --save-dev karma-typescript-cssmodules-transform

Configuration

In the karma-typescript section of karma.conf.js:

karmaTypescriptConfig: {
    bundlerOptions: {
        transforms: [
            require("karma-typescript-cssmodules-transform")()
        ]
    }
}

Options

Custom options can be passed to the runner in the first argument when calling the plugin:

  • PostCSS options. Optional, but the properties to and from are always set to the filename of the CSS file automatically.
  • Custom options. Optional, defaults to:
{
    generateScopedName: "[name]_[local]_[hash:base64:5]",
    mode: "local" // valid options are "local" | "global" | "pure"
}
  • A RegExp object to filter which files should be processed.
    Optional, defaults to /\.css$/.

An example using a custom scope name generator string and a RegExp filter:

karmaTypescriptConfig: {
    bundlerOptions: {
        transforms: [
            require("karma-typescript-cssmodules-transform")(
                {}, { generateScopedName: "[local]___[hash:base64:5]" } /\.css$/
            )
        ]
    }
}

Licensing

This software is licensed with the MIT license.

© 2016-2021 Erik Barke, Monounity

Keywords

FAQs

Package last updated on 01 May 2023

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