Skip to content

Commit

Permalink
Merge pull request #20 from vordgi/ncm-19
Browse files Browse the repository at this point in the history
ncm-19 Add Troubleshoot section to readme
  • Loading branch information
vordgi authored Sep 10, 2023
2 parents ba2084d + 9db942d commit 99424c6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Next classnames minifier

[![npm version](https://badge.fury.io/js/next-classnames-minifier.svg)](https://badge.fury.io/js/next-classnames-minifier)

Library for configuring style _(css/scss/sass)_ modules to generate compressed classes (`.header` -> `.a`, `.nav` -> `.b`, ..., `.footer` -> `.aad`, etc.)

## Reasons
Expand Down Expand Up @@ -63,6 +65,14 @@ module.exports = withPlugins([
], nextConfig);
```

## Troubleshoot

The main problem is the next.js caching system. It may create the "Home" page first and cache it with classes `.a`, `.b`, `.c`, etc.

Next time Next.js will create the "About" page first and those classes will be created for that page, but "Home" page with the same classes will be read from the page.

The best way to fix this is to not reuse the next.js cache (_don't cache `.next` folder_). Instructions for Vercel can be found at [vercel doc page](https://vercel.com/docs/deployments/troubleshoot-a-build#managing-build-cache).

## License

[MIT](https://github.com/vordgi/next-classnames-minifier/blob/main/LICENSE)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-classnames-minifier",
"version": "1.1.2",
"version": "1.1.3",
"description": "Library for configuring style modules to generate compressed classes",
"main": "dist/withClassnamesMinifier.js",
"types": "dist/withClassnamesMinifier.d.ts",
Expand Down

0 comments on commit 99424c6

Please sign in to comment.