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

jest-css-modules-processor

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-css-modules-processor

realize import css during testing

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jest-css-modules-processor

You can use this module to realize import / require .css file when you run jest. And this module also support localIdentName😎!

Inspired by css-modules-require-hook and jest-css-modules-transform.

Install

yarn add jest-css-modules-processor --dev

Usage

Just add transform field for your jest config.

// package.json
{
  "jest": {
		"transform": {
			".+\\.(css)$": "@mtfe/jest-css-modules-processor",
			"^.+\\.jsx?$": "babel-jest"
		},
  }
}

Config

You should add jestCSSProcessor field in your package.json.

// package.json
{
  "jestCSSProcessor": {
    "generateScopedName": "[name]__[local]___[hash:base64:5]"
  }
}
optiondescriptionrequired
camelCasesame as css-loader?cameCaseno
devModeNODE_ENV === 'development'no
processCssprocess(transformedCSS, filename)no
processOptionshttp://api.postcss.org/global.html#processOptionsno
createImportedNamehttps://github.com/css-modules/postcss-modules-extract-imports/blob/master/src/index.js#L73no
generateScopedNamefor example [name]__[local]___[hash:base64:5]no
modelocal or globalno
resolveresolveOptsno
rootDirsame as webpack context optionno

Usually, you just need to set the generateScopedName option. And it should same as localIndentName value which you setted in the webpack.config.js

Keywords

FAQs

Package last updated on 19 Feb 2019

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