inject-body-webpack-plugin
v1.3.0
Published
Webpack plugin that injects a custom string into the body of the html-webpack-plugin output.
Downloads
4,606
Maintainers
Readme
inject-body-webpack-plugin
Webpack plugin that injects a custom string into the body of the html-webpack-plugin output.
Installation
npm install --save-dev inject-body-webpack-plugin@^1.3.0
yarn add --dev inject-body-webpack-plugin@^1.3.0
Example
Input
webpack.config.babel.js
import HtmlWebpackPlugin from "html-webpack-plugin"
import InjectBodyPlugin from "inject-body-webpack-plugin"
export default {
plugins: [
new HtmlWebpackPlugin({
templateContent: "<html><body></body></html>"
}),
new InjectBodyPlugin({
content: '<main id=root>Hi!</main>'
}),
],
}
Output
index.html
<html><body><main id=root>Hi!</main></body></html>
Options
Development
Setting up:
git clone [email protected]:jaid/inject-body-webpack-plugin.git
cd inject-body-webpack-plugin
npm install
Testing in production environment:
npm run test
License
MIT License
Copyright © 2021, Jaid <[email protected]> (https://github.com/jaid)