Skip to content

Commit

Permalink
Revert "chore: update README (#10)"
Browse files Browse the repository at this point in the history
This reverts commit 008a143.
  • Loading branch information
dlehmhus committed Feb 25, 2023
1 parent bfe3756 commit 9cfc1bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,6 @@ export default function RootLayout({

This convention is needed because the loader needs to know which files contain global styles and which don't.

## Config

For details on the config options, see the [Linaria Config](https://github.com/callstack/linaria/blob/master/docs/CONFIGURATION.md).

### Plugin specific config

`enableInMemoryCache` (default: `true`).

If set to `true`, the loader will generate a hash for the file content and store the transformed code in memory and only re-run the transformation if the file has changed. This can increase performance when working with large files. However, hashing the file content, even though it is pretty fast compared to the transformation, can still take some time. If you are experiencing performance or memory issues, you can disable this feature.

## Good to know

Because webpack 5 caches modules, the virtual CSS Modules need to be cached as well (so at that point the are not really virtual anymore, are they? Anyway...). They are placed in the same directory as where webpack puts its cache files. If the `next-with-linaria` cache is not in sync with the webpack cache anymore, it will cause errors due to missing CSS Modules. If you encounter such an error, you can delete the `.next/cache/webpack` folder and restart the dev server.
6 changes: 3 additions & 3 deletions src/loaders/transformLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export const regexLinariaCSS = /\.linaria\.(module|global)\.css$/;
export type LinariaLoaderOptions = {
/**
* Enable in-memory cache for transformed code.
* This can increase performance when working with big files.
* However, the downside is that every file needs to be hashed and
* is stored in memory. Disable this if you are experiencing memory issues.
* This can increase performance gains when working with big files.
* However, downside is that every file needs to be hashed and
* stored in memory.
*
* @default true
*/
Expand Down

0 comments on commit 9cfc1bb

Please sign in to comment.