wepy-compiler-scss2

1.0.3 • Public • Published

wepy scss 编译器

支持postcss插件的 wepy scss 编译器。

安装

npm install wepy-compiler-scss2 --save-dev

配置wepy.config.js

module.exports = {
    compilers: {
        scss2: {
            outputStyle: 'compressed',
            // 支持postcss
            postcss: {
                plugins: [
                    // 可以将 px 转换成 rpx 的插件 
                    require('postcss-pxtorpx')({
                        multiplier: 2,
                        unitPrecision: 5,
                        propList: ['*'],
                        selectorBlackList: [],
                        replace: true,
                        mediaQuery: false,
                        minPixelValue: 2
                    }),
                ]
            }
        }
    }
};

使用

使用时只需将<style>的lang属性设置为scss2即可:

<style lang="scss2">

</style>

参数说明

除了 postcss 这个参数,其余参数均为 node-sass 的参数, 此插件仅支持scss模式。

Package Sidebar

Install

npm i wepy-compiler-scss2

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

2.91 kB

Total Files

3

Last publish

Collaborators

  • xiaohuoche