0.1.1 • Published 6 years ago

weapp-plugin-replace v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

weapp-plugin-replace

替换文件文本

安装

npm i weapp-plugin-replace -D

使用

weapp.config.js

module.exports = {
  plugins: [
    ['weapp-plugin-replace', {
        match: /\.wxss$/,
        config: {
          find: /([0-9])px/,
          replace: (match, count) => {
            return count + 'rpx'
          }
        }
    }],
  ],
};
module.exports = {
  plugins: [
    ['weapp-plugin-replace', {
      config: [{
        find: '1',
        replace: '11'
      },{
        find: '2',
        replace: '22'
      }]]
    },
  ],
};