Skip to content

给打包后的html文件替换指定内容 using webpack, HTMLWebpackPlugin

License

Notifications You must be signed in to change notification settings

choukin/html-webpack-inject-temp-afteremit-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

替换文件内容插件

license

Installation

You must be running webpack on node 6.4 or higher

Install the plugin with npm:

$ npm install --save-dev html-webpack-inject-temp-afteremit-plugin

Install the plugin with yarn:

$ yarn add --dev html-webpack-inject-temp-afteremit-plugin

Basic Usage

Require the plugin in your webpack config:

var HtmlWebpackInjectTempalfterEmitPlugin = require('html-webpack-inject-temp-afteremit-plugin');

Add the plugin to your webpack config as follows:

{
	...
	plugins: [
	  new HtmlWebpackPlugin(),
	  new HtmlWebpackInjectTempalfterEmitPlugin({
		  targetStr: `替换成的内容`,
           sourceStr:`要替换的内容`
        }
	  })
	]
	...
}

开发


  • npm 包中 sudo npm link

  • 使用的npm中 sudo npm link package-name

About

给打包后的html文件替换指定内容 using webpack, HTMLWebpackPlugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published