使用 ant-design-vue时,错误信息
ERROR Failed to compile with 1 error
error in ./node_modules/ant-design-vue/dist/antd.less
Syntax Error:
// https://github.com/ant-design/ant-motion/issues/44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
解决方法
less-load版本低于6.0时:vue.config.js 配置
module.exports = defineConfig({
transpileDependencies: true,
css: {
loaderOptions: {
less: {
javascriptEnabled: true
}
}
}
})
less-load版本高于6.0时:vue.config.js 配置
module.exports = defineConfig({
transpileDependencies: true,
css: {
loaderOptions: {
less: {
lessOptions: {
javascriptEnabled: true
}
}
}
}
})