Home

Awesome

wepy-plugin-preprocess

用途

安装

npm install wepy-plugin-preprocess --save-dev

配置wepy.config.js

module.exports.plugins = {
    'preprocess': {             //加载 wepy-plugin-preprocess
        filter: /config\.js$/,  //条件
        context: {              //preprocess 的context参数
            ENV: 'prod'
        }
    }
};


module.exports.plugins = {
    'preprocess': [
        {
            filter: /config\.js$/,
            context: {
                ENV: 'prod'
            }
        }, {
            filter: /index\.html$/,
            context: {
                ENV: 'prod'
            }
        }
    ]
};

module.exports.plugins = {
    'preprocess': {
        'process-js': {
            filter: /config\.js$/,
            context: {
                ENV: 'prod'
            }
        },
        'process-html': {
            filter: /index\.html$/,
            context: {
                ENV: 'prod'
            }
        }
    }
};