How to use lib-flexible px2rem to compile scss successfully and how to configure loader in vue-cli environment

how to successfully compile scss using lib-flexible px2rem in the vue-cli environment
scss is written in the .vue file and configured build/utils.js

 <style lang="scss">
    $c:pink;
    .test{
        width:200px;
        height:200px;
        background-color:$c;
    }
 </style>

then run on chorme"s mobile viewport and still display px instead of rem

Oct.10,2021

loaders with less px2remLoader
const loaders = options.usePostCSS? [cssLoader, postcssLoader, px2remLoader]: [cssLoader, px2remLoader]

Menu