Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/haoliangyu/html-webpack-processing-plugin
html-webpack-plugin extension for html pre-processing and post-processing
https://github.com/haoliangyu/html-webpack-processing-plugin
event html-webpack-plugin webpack webpack-plugin
Last synced: about 1 month ago
JSON representation
html-webpack-plugin extension for html pre-processing and post-processing
- Host: GitHub
- URL: https://github.com/haoliangyu/html-webpack-processing-plugin
- Owner: haoliangyu
- License: mit
- Created: 2016-10-30T17:09:36.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T11:12:20.000Z (almost 2 years ago)
- Last Synced: 2024-08-11T11:56:48.898Z (3 months ago)
- Topics: event, html-webpack-plugin, webpack, webpack-plugin
- Language: JavaScript
- Size: 1.24 MB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# html-webpack-processing-plugin
[![npm](https://img.shields.io/npm/v/html-webpack-processing-plugin)](https://www.npmjs.com/package/html-webpack-processing-plugin) [![NPM](https://img.shields.io/npm/l/html-webpack-processing-plugin)](https://github.com/haoliangyu/html-webpack-processing-plugin/blob/master/LICENSE) [![Build Status](https://www.travis-ci.org/haoliangyu/html-webpack-processing-plugin.svg?branch=master)](https://www.travis-ci.org/haoliangyu/html-webpack-processing-plugin)
HTML pre-processing and post-processing for [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin). It supports webpack v4.
## Installation
```bash
npm install html-webpack-processing-plugin
```## Usage
- add pre-processor
```javascript
const HtmlWebpackPlugin = require("html-webpack-plugin");
const HtmlWebpackProcessingPlugin = require("html-webpack-processing-plugin");const webpackConfig = {
";
entry: "index.js",
output: {
path: "dist",
filename: "index_bundle.js",
},
plugins: [
new HtmlWebpackPlugin({
preProcessing: (originalHTML) => {
let newHTML = originalHTML + "
return newHTML;
},
}),
new HtmlWebpackProcessingPlugin(),
],
};
```- add post-processor
```javascript
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackProcessingPlugin = require('html-webpack-processing-plugin';)const webpackConfig = {
';
entry: 'index.js',
output: {
path: 'dist',
filename: 'index_bundle.js'
},
plugins: [
new HtmlWebpackPlugin({
postProcessing: originalHTML => {
let newHTML = originalHTML + '
return newHTML;
}
}),
new HtmlWebpackProcessingPlugin()
]
};
```## License
This project is licensed under MIT.