react+webpack5+antd中less报错 Module build failed (from ./node_modules/less-loader/dist/cjs.js): ···.bezierEasingMixin()
// https://github.com/ant-design/ant-motion/issues/44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
Error in D:\workspace\my-react-demo\node_modules\antd\lib\style\color\bezierEasing.less (line 110, column 0)
问题:
解决方式
- webpack 中配置
//处理less文件
{
test: /\.less$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
},
{
loader: 'less-loader',
options: {
/**
* 解决less报错 错误信息 https://github.com/ant-design/ant-motion/issues/44
*/
lessOptions: {
javascriptEnabled: true
}
}
}
],
},
issue: https://github.com/ant-design/ant-motion/issues/44
另一篇:https://juejin.cn/post/6844904160819691527