@krutoo/jest-css-modules-transform
v0.0.3
Published
Jest transformer for css-modules
Downloads
32
Readme
Jest transformer for css-modules
This package is needed for transform css-modules in Jest.
It supports CSS, Sass and SCSS.
Installation
npm i -D @krutoo/jest-css-modules-transform
Usage
Add transform rule to your Jest configuration:
// jest.config.js
export default {
transform: {
// will transform files like "foo.module.css", "foo.m.css", "foo.module.sass"...
'\\.(module|m)\\.(css|sass|scss)$': '@krutoo/jest-css-modules-transform',
},
};
Options
You can set options for this transformer:
// jest.config.js
export default {
transform: {
'\\.module\\.css$': [
'@krutoo/jest-css-modules-transform',
{
// by default this transformer will emit CJS, but you can force it to emit MJS syntax
type: 'module',
},
],
},
};
To Do
- explore and implement Jest caching of transform results
- implement ability of selecting sass package (
sass
orsass-embedded
)