[solved] how to configure sass for mpvue

Business background

use mpvue
for the first time sass before, but it"s all configured by someone else.
has not used webpack

.

my actions

  1. initialize the project according to mpvue tutorial
  2. copy the sample file pages/counter is pages/counter2
  3. modify pages/counter2/index.vue File
  4. add style tag to lang=sass inside.
  5. then in the command line npm run dev

the file cannot be compiled at this time

question

should be mpvue is not configured sass compilation
I"m going to learn webpack and vue-cli , but these two things feel like I can"t get into the door all week
, so how do you configure sass to compile automatically in mpvue ?

solve

install the dependency package directly with npm . After installation, it will compile automatically without configuration.

 npm i sass-loader -D / npm i node-sass -D

reference: https://github.com/Meituan-Di.

Mar.01,2021

just install the dependency package with npm directly. After installation, there is no need to configure, and it will be compiled automatically

npm I sass-loader-D / npm I node-sass-D
reference: https://github.com/Meituan-Dianping/mpvue/issues/232

Menu