/Jest-CSS-Modules

Jest processor that prevents CSS module parse errors

Primary LanguageJavaScript

Jest CSS Modules

A Jest script processor that prevents CSS module parse errors.

Installation

npm install --save-dev jest-css-modules

Update your package.json file's jest configuration:

{
  "jest": {
    "scriptPreprocessor": "<rootDir>/node_modules/jest-css-modules",
  }
}

Now, imports such as import styles from './MyModule.css'; will pass through Jest without causing any pain.

Supports .css, .less, and .scss extensions.