1.0.0 • Published 7 years ago

wepy-plugin-replaces v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

wepy 字符串替换插件

安装

npm install wepy-plugin-replaces --save-dev

配置wepy.config.js

单个字符串替换

module.exports.plugins = {
    replaces: {
        filter: /index\.js$/,
        config: {
            find: 'DEMO',
            replace: 'AAAA'
        }
    }
};

多个字符串替换

module.exports.plugins = {
    replaces: [{
            filter: /index\.js$/,
            config: {
                find: 'DEMO',
                replace: 'AAA'
            }
        },
        {
            filter: /\.js/,
            config: {
                find: 'CDN_URL',
                replace: 'test'
            }
        }
    ]
};

版本日志

  • v1.0.0 完成字符串替换功能