欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

webpack实现px自动动转换成rem

程序员文章站 2022-03-21 13:13:25
1、px2rem-loader{ test: /.less$/, use: [ MiniCssExtractPlugin.loader, 'css-loader', { loader: 'px2rem-loader', options: { remUnit: 75, remPrecision: 8 ....

1、px2rem-loader

 

{
    test: /.less$/,
    use: [
        MiniCssExtractPlugin.loader,
        'css-loader',
        {
            loader: 'px2rem-loader',
            options: {
                remUnit: 75,
                remPrecision: 8
                    }
        },
        'less-loader',
        {
            loader: 'postcss-loader',
            options: {
                plugins: () => [
                    require('autoprefixer')({
                        browsers: ['last 2 version', '>1%', 'ios 7']
                                            })
                                ]
                    }
        }
        ]
  },


 

 

<head>
<link href="./meta.html?__inline">
<title>Document</title>
<script type="text/javascript" src="../../node_modules/lib-flexible/flexible.js?__inline"></script>
</head>

 

本文地址:https://blog.csdn.net/liixnhai/article/details/107901007

相关标签: webpack