Commit 787c542
authored
feat: Babel Plugin - Mock css imports (#1607)
Created a Babel transform plugin `mockCssImportPlugin` that transforms
certain css imports into const expressions.
- Replaces import of `.module.css` / `.module.scss` - with a const
object literal containing a key / value of the module name
- Replaces css imports of `?inline` and `?raw` with a const string
literal matching the import path
The new plugin is configured as a plugin for `babel-jest`
resolves #16061 parent a260842 commit 787c542
15 files changed
Lines changed: 121 additions & 60 deletions
File tree
- __mocks__/css
- packages
- babel-preset
- components/src
- __snapshots__
- theme
- __snapshots__
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 18 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
0 commit comments