songsiqi / px2rem

According to one stylesheet, generate rem version and @1x, @2x and @3x stylesheet.
558 stars 92 forks source link

webpack插件.less文件怎么搞 #1

Closed younth closed 8 years ago

younth commented 8 years ago
            {
                test: /\.less$/,
                loader: 'style-loader!css-loader!autoprefixer-loader?{browsers:["android 4", "ios 6", "last 1 Chrome versions", "last 2 Safari versions"]}!less-loader'
            }

这是当前的的配置,想用px2rem-loader,但直接加到这个loader后面会报错,想问下处理less文件的话,要怎么配置呢?

songsiqi commented 8 years ago

@younth 这样试试:

    {
        test: /\.less$/,
        loader: "style!css!px2rem!less"
    }
younth commented 8 years ago

@songsiqi 来晚了,这个问题已经解决,多谢~

peterzhai commented 7 years ago

请问在Vue中怎么解决?

fantasy525 commented 7 years ago

使用vue-cli的话可以配置postCss插件,使用postcss-px2rem这个插件,我是在stylus中写的css,你在less写的话应该一样