base-href-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

base-href-webpack-plugin (extension)

npm version

Extension for html-webpack-plugin to programmatically insert or update <base href="" /> tag.

Prerequisites

This plugin is an extension of html-webpack-plugin.
So make sure you have installed npm i --save-dev html-webpack-plugin.

Installation

For webpack v5 use latest (^3.0.0):
npm i --save-dev base-href-webpack-plugin

For webpack v4 use ^2.0.0:
npm i --save-dev base-href-webpack-plugin@2

For webpack v3 use ^1.0.0:
npm i --save-dev base-href-webpack-plugin@1

Usage

const { BaseHrefWebpackPlugin } = require('base-href-webpack-plugin');

// Add to plugins
plugins: [
  new HtmlWebpackPlugin(), // Required dependency
  new BaseHrefWebpackPlugin({ baseHref: '/' })
]

Plugin leaves your template untouched if baseHref option is not provided.

Contribution

Feel free to contribute to this project by submitting issues and/or pull requests.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i base-href-webpack-plugin

Weekly Downloads

10,107

Version

3.0.1

License

MIT

Unpacked Size

9 kB

Total Files

8

Last publish

Collaborators

  • dzonatan