@zipeapps/html-replace-webpack-plugin

2.6.0 • Public • Published

[html-replace-webpack-plugin] fork

An upgraded version of Webpack plugin that replaces HTML contents with custom pattern string or regex.

For more information visit documentation of original plugin: [html-replace-webpack-plugin]

Changes

Replacement function now provides a relative path of a currently edited file.

var webpack = require('webpack')
var HtmlReplaceWebpackPlugin = require('html-replace-webpack-plugin')

module.exports = {
  plugin: [
    new HtmlWebpackPlugin({
      /* configs */
    }),
    new HtmlReplaceWebpackPlugin([
      {
        pattern: /Hello world/g,
        replacement: function(match, filePath, groups) {
          return `Goodbye world at ${filePath}`;
        }
      }
    ])
  ]
}

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i @zipeapps/html-replace-webpack-plugin

    Weekly Downloads

    1

    Version

    2.6.0

    License

    MIT

    Unpacked Size

    8.53 kB

    Total Files

    9

    Last publish

    Collaborators

    • andrewlevada