html-webpack-string-replace-plugin

1.1.0 • Public • Published

String Replace for the HTML Webpack Plugin

npm version

This webpack plugin is to be used in conjunction with html-webpack-plugin. It provides a way for us to use webpack to copy HTML files and perform string manipulations

Installation

Install the plugin with npm:

$ npm install -D html-webpack-string-replace-plugin

Usage

Require the plugin in your webpack config:

const HtmlWebpackStringReplacePlugin = require('html-webpack-string-replace-plugin');

Add the plugin to your webpack config as follows:

plugins: [
    new HtmlWebpackPlugin({
      "template": "./src/login.html",
      "filename": "./login.html",
    }),
 
    new HtmlWebpackStringReplacePlugin({
      '_VERSION_': '1.0',
      '_CDN_': 'https://some-cdn',
    })
]

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i html-webpack-string-replace-plugin

      Weekly Downloads

      359

      Version

      1.1.0

      License

      MIT

      Unpacked Size

      3.39 kB

      Total Files

      5

      Last publish

      Collaborators

      • olore