Answer the question
In order to leave comments, you need to log in
How to include less in create-react-app?
I connect the .less style files of the antd library, in the console there is such an error:
./src/theme.dark.less (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-8-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-8-3!./node_modules/less-loader/dist/cjs.js??ref--5-oneOf-8-4!./src/theme.dark.less)
TypeError: this.getOptions is not a function
import './theme.dark.less';
.dark {
@import '~antd/lib/style/themes/default.less';
@import '~antd/dist/antd.dark.less';
@body-background: #000220;
@primary-color: #d5b50b;
}
{
test: /\.less$/,
use: getStyleLoaders(
{
importLoaders: 3,
sourceMap: isEnvProduction
? shouldUseSourceMap
: isEnvDevelopment,
},
'less-loader',
{
lessOptions: {
javascriptEnabled: true
}
}
),
sideEffects: true,
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question