The project built using vue-cli prompts "loaderContext.getResolve is not a function" in the configuration of less

The project built using vue-cli prompts "loaderContext.getResolve is not a function" in the configuration of less

Problem Description

In the webpack project created by using vue cli, I want to configure less preprocessing. After the configuration is completed, the error message "loaderContext.getResolve is not a function" appears, as follows.
insert image description here

Cause of the problem

The version of less installed is too high, and the versions of less and less-loader are as follows.
insert image description here

Solution

Directly modify the version number of less in the package.json file, and re-npm install the dependent package. The modified less version number is as follows.
insert image description here
Reference address
Portal 1
Portal 2

Guess you like

Origin blog.csdn.net/weixin_39893889/article/details/106156979