npm安装 less less-loader
npm install --save less less-loader
使用less报错处理
vue版本跟less-loader版本不匹配导致。
ERROR in .//css-loader?sourceMap!.//vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-49b9d893","scoped":false,"hasInlineConfig":false}!.//less-loader/dist/cjs.js!.//vue-loader/lib/selector.js?type=styles&index=0!./src/pages/About.vue
Module build failed: TypeError: this.getOptions is not a function
at Object.lessLoader (/Users/ying/web/vueDemo/node_modules/less-loader/dist/index.js:21:24)
@ .//vue-style-loader!.//css-loader?sourceMap!.//vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-49b9d893","scoped":false,"hasInlineConfig":false}!.//less-loader/dist/cjs.js!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/pages/About.vue 4:14-339 13:3-17:5 14:22-347
解决方法
降低less-loader版本
npm install less-loader@4.1.0