0.0.6 • Published 2 years ago

inject-webpack-plugin-head v0.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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 git@github.com:Emiyaa/inject-webpack-plugin-head.git
cd inject-webpack-plugin-head
npm install

Testing in production environment:

# 打包
npm run build
# 发包 
npm publish
# 删除发错包
npm unpublish inject-webpack-plugin-head@0.0.5 --force