vue项目引用less报错

在main导入import './assets/style/theme.less'
如果找不到less, 需安装less依赖:
npm install less
可能还需要 npm install less-loader

如果报一下错误:
error in ./src/assets/style/theme.less

Module build failed:

// ant-design/ant-motion#44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?

解决例子: http://www.jsphp.net/webpack/show-26-343-1.html

其中可能把less从3+版本降到2.7.3也可以
在package.json修改:
less: 2.7.3
npm install less
即可~

posted @ 2020-07-21 15:03  fengzao  阅读(1232)  评论(0编辑  收藏  举报