Skip to content

Commit

Permalink
chore: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nvh95 committed Apr 14, 2022
1 parent 907155a commit c5bd7f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 84 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ pnpm install --dev jest-preview

### 2. Configure jest's transform to transform CSS and files

`jest-preview` comes with pre-configured transformations to intercept CSS and files. This is a recommended way to configure. However, you can configure it yourself using exported transform functions as well. See [Advanced configurations](#advanced-configurations) for more
`jest-preview` comes with pre-configured transformations to intercept CSS and files. This is a recommended way to configure. However, you can configure it yourself using exported transform functions as well. See [Advanced configurations](#advanced-configurations) for more.

Update `jest.config.js`:

```json
// jest.config.js
transform: {
"^.+\\.css$": "jest-preview/transforms/css",
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "jest-preview/transforms/file",
},
"^.+\\.css$": "jest-preview/transforms/css",
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "jest-preview/transforms/file",
}
```

For Create React App users, please use `jest-preview/transforms/fileCRA` instead of `jest-preview/transforms/file`. See more at [examples/create-react-app/README.md](./examples/create-react-app/README.md#installation-and-usage)
Expand Down
76 changes: 0 additions & 76 deletions cssTransform.js

This file was deleted.

6 changes: 3 additions & 3 deletions examples/create-react-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ Except for step 2 of installation: **Configure jest's transform to transform CSS

```json
transform: {
// Other transforms
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "jest-preview/transforms/file",
},
// Other transforms
"^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)": "jest-preview/transforms/file",
}
```

## Caveats
Expand Down

0 comments on commit c5bd7f0

Please sign in to comment.