Skip to content

deep-fish-pixel/ouput-replace-webpack-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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}`;
           }, 
        }
    ],
})

About

replace output file content webpack plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published