ouput-replace-webpack-plugin

1.0.1 • Public • Published

ouput-replace-webpack-plugin

replace output file content

Install

Install with npm:

$ npm install --save-dev ouput-replace-webpack-plugin

Examples

new OutputReplaceWebpackPlugin({
    file: 'test.json',
    match: /\d+\/\d+\/\d+/g,
    conent: formatDate(new Date(), 'yyyy-MM-dd~hh:mm:ss'),
})

new OutputReplaceWebpackPlugin({
    replaces: [
        {
           file: 'test.json',
           match: /\d+\/\d+\/\d+/g,
           conent: formatDate(new Date(), 'yyyy-MM-dd~hh:mm:ss'), 
        },
        {  
           file: 'test.json',
           match: /(\d+\.\d+\.)(\d+)/g,
           conent: (all, $1, $2) => {
            return `${$1}${$2 + 1}`;
           }, 
        }
    ],
})

Package Sidebar

Install

npm i ouput-replace-webpack-plugin

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

2.75 kB

Total Files

3

Last publish

Collaborators

  • maweimaweima