base-href-webpack-plugin (extension for html-webpack-plugin)
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 v3:
npm i --save-dev base-href-webpack-plugin@1
For webpack v4:
npm i --save-dev base-href-webpack-plugin
Usage
const { BaseHrefWebpackPlugin } = require('base-href-webpack-plugin');
plugins: [
new HtmlWebpackPlugin(),
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