SoFunction
Updated on 2025-03-04

Solve the loader problem of vue-cli creating project

When creating a project using vue-cli project, when using sass and other precompiled CSS languages, you do not need to configure it in config, you only need to install the corresponding loader in the project.

For example:

1. Use sass in the project

$ npm i node-sass -D
$ npm i sass-loader -D

2. When using vuex, even if vux and vux-loader are installed and vux-loader is used in the project, the project cannot start, and the error is as follows:

These dependencies were not found:

* !!vue-style-loader!css-loader?{"minimize":false,"sourceMap":false}!../../../../vue-loader/lib/style-compiler/index?{"vue":true,"id":"da
ta-v-28d8bf8a","scoped":false,"hasInlineConfig":false}!../../../../vux-loader/src/!less-loader?{"sourceMap":false}!..
/../../../vux-loader/src/!../../../../vue-loader/lib/selector?type=styles&index=0!./ in ./~/vux/src/components/ce
ll/
* !!vue-style-loader!css-loader?{"minimize":false,"sourceMap":false}!../../../../vue-loader/lib/style-compiler/index?{"vue":true,"id":"da
ta-v-76475f48","scoped":false,"hasInlineConfig":false}!../../../../vux-loader/src/!less-loader?{"sourceMap":false}!..
/../../../vux-loader/src/!../../../../vue-loader/lib/selector?type=styles&index=0!./ in ./~/vux/src/components/gr
oup/

To install them, you can run: npm install --save !!vue-style-loader!css-loader?{"minimize":false,"sourceMap":false}!../../../../vue-loade
r/lib/style-compiler/index?{"vue":true,"id":"data-v-28d8bf8a","scoped":false,"hasInlineConfig":false}!../../../../vux-loader/src/after-le
!less-loader?{"sourceMap":false}!../../../../vux-loader/src/!../../../../vue-loader/lib/selector?type=styles&i
ndex=0!./ !!vue-style-loader!css-loader?{"minimize":false,"sourceMap":false}!../../../../vue-loader/lib/style-compiler/index?{"v
ue":true,"id":"data-v-76475f48","scoped":false,"hasInlineConfig":false}!../../../../vux-loader/src/!less-loader?{"sou
rceMap":false}!../../../../vux-loader/src/!../../../../vue-loader/lib/selector?type=styles&index=0!./
> Listening at http://localhost:8080

A brief look can be confirmed that there is a problem with the loader, but I have installed the sass compilation dependency and still cannot solve the error.

Later, I went to the vux package and looked at it. The component was used less, so I installed less dependencies to solve the problem.

The above article solves the loader problem of vue-cli creation project is all the content I share with you. I hope it can give you a reference and I hope you can support me more.