inject-webpack-plugin-head
v0.0.6
Published
Webpack plugin that injects a custom string into the head of the html-webpack-plugin output.
Downloads
3
Readme
inject-webpack-plugin-head
Installation
npm install --save-dev inject-webpack-plugin-head
yarn add --dev inject-webpack-plugin-head
Example
Input
webpack.config.babel.js
import HtmlWebpackPlugin from "html-webpack-plugin"
import InjectHeadPlugin from "inject-webpack-plugin-head"
export default {
plugins: [
new HtmlWebpackPlugin({
templateContent: "<html><head></head></html>"
}),
new InjectHeadPlugin({
content: '<main id=root>Hi!</main>'
}),
],
}
Output
index.html
<html><head><main id=root>Hi!</main></head></html>
Options
Development
Setting up:
git clone [email protected]:Emiyaa/inject-webpack-plugin-head.git
cd inject-webpack-plugin-head
npm install
Testing in production environment:
# 打包
npm run build
# 发包
npm publish
# 删除发错包
npm unpublish [email protected] --force