with-ant-design-less can't work together with cssModule
See original GitHub issueExamples bug report
Example name
Describe the bug
Using ant-design-less with cssModule makes all ant design style disappear.
To Reproduce
- Go to ‘next.config.js’
- Add this code snippets into withLess option
cssModules: true,
cssLoaderOptions: {
importLoaders: 1,
localIdentName: '[local]___[hash:base64:5]',
},
- Save
- All ant design style is gone
Expected behavior
The example should apply ant design style when cssModule option is set to true.
Screenshots
Before apply cssModule
After apply cssModule
System information
- OS: macOS
- Browser: Any browser
- Version of Next.js: 9.0.2
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Module.css is not working in React.So css can't proceed either ...
As shown in the picture above, classname was assigned to the div tag, but there was a problem that could not be applied...
Read more >Using CSS Module Scripts to import stylesheets - web.dev
With the new CSS module scripts feature, you can load CSS style sheets with import statements, just like JavaScript modules.
Read more >What are CSS Modules and why do we need them?
I've been intrigued by CSS Modules lately. If you haven't heard of them, this post is ... First, remember how HTML and CSS...
Read more >How to configure CSS Modules for webpack - LogRocket Blog
In the following code block, css-loader and style-loader are used together. Similar to babel-loader , we can load CSS files to style our...
Read more >Using CSS Modules in React - OpenReplay Blog
A different way to work with CSS styling in React apps. ... random CSS classes that are only visible when the page is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After taking the time to research I found that setting cssModule to
true
turn the whole project to use cssModule but some node_modules likeantd
doesn’t implement by using cssModule.So, I customized @zeit/next-less to support work like this.
next-antd-less.config.js
then use it in next.config.js
In my case, it usually works. Hopefully, It will help someone to solve the problem to work with antd together with cssModule.
Related example/issues/modules which I use to compose the solution. #8054 #7957 with-ant-design-less next-antd-aza-less
Anyway, if there is an official solution for this issue it will be very good. In my opinion, it will be a common issue.
how to add withSass in config