about less modules
See original GitHub issuemy code is as follows config-overrides.js
const { override, fixBabelImports, addLessLoader } = require('customize-cra');
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
addLessLoader({
localIdentName: "[name]__[local]--[hash:base64:5]",
javascriptEnabled: true,
modifyVars: { '@primary-color': '#25b864' },
}),
);
There’s no problem when it’s used like this
import './index.less';
I want to use a. Less file like this
import styles from './index.less';
import cls from 'classnames';
When I print like this
console.log('styles:',styles)
the result is {}
When I change the .less file to the .module.less file, an error will be reported again
why?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Getting started | Less.js
Less extends CSS with dynamic behavior such as variables, mixins, operations and functions. Less runs on both the server-side (with Node.js and Rhino)...
Read more >CSS Modules vs Less | What are the differences? - StackShare
Less is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques...
Read more >React + CSS Modules + LESS + Webpack 4 | by Joe Crick
What I wanted to do was setup my app to use CSS Modules. ... Setup and configuration of LESS + CSS Modules in...
Read more >less-loader | webpack - JS.ORG
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >Can I use css-modules with LESS + nesting? - Stack Overflow
I think it's more clear which styles build on top of other styles if I can actually nest them in code. But I...
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 Free
Top 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
@shx996 This is not working in my case. Now I get an error
`ValidationError: Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema.
Right:xxx.module.less