Webpack plugin that injects a custom string into the body of the html-webpack-plugin output.
npm install inject-body-webpack-pluginWebpack plugin that injects a custom string into the body of the html-webpack-plugin output.
``bash`
npm install --save-dev inject-body-webpack-plugin@^1.3.0
`bash`
yarn add --dev inject-body-webpack-plugin@^1.3.0
#### Input
webpack.config.babel.js
`js
import HtmlWebpackPlugin from "html-webpack-plugin"
import InjectBodyPlugin from "inject-body-webpack-plugin"
export default {
plugins: [
new HtmlWebpackPlugin({
templateContent: "
#### Output
index.html
`html
Hi!
`Options
Type
Default
Info
content
string
<div id=root/>
The text that will be inject into the final HTML output.
position
string
start
If “start”, the content will be injected as close to the body opening tag as possible. If “end”, the content will be injected as close to the body ending tag as possible.
Development
Development hints for maintaining and improving inject-body-webpack-plugin
Setting up:
`bash
git clone git@github.com:jaid/inject-body-webpack-plugin.git
cd inject-body-webpack-plugin
npm install
`
Testing in production environment:
`bash
npm run test
``