html-replace-all-webpack-plugin

1.0.1 • Public • Published

html-replace-all-webpack-plugin

This support all replace html operates in webpack by string or regexp.

Install

$ npm install --save html-replace-all-webpack-plugin

Usage

replace one match
new HtmlReplaceWebpackPlugin({
  matches: [{
    match: /<body>/,
    value: `<body>hello World!`,
  }]
})
replace two match
new HtmlReplaceWebpackPlugin({
  matches: [{
    matchStart: /<body>/,
    matchEnd: /<\/body>/,
    value: `<body>hello World!</body>`,
  }]
})
replace object all values by properties
new HtmlReplaceWebpackPlugin({
  matchObjects: [{
    prefix: '${',
    suffix: '}',
    target: {
      title: 'Test matchObject',
      content: 'hello World!'
    }
  }]
})

Package Sidebar

Install

npm i html-replace-all-webpack-plugin

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • maweima