Skip to content

Commit

Permalink
Support to webpack 5 added
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutoshSce committed Feb 16, 2021
1 parent daf6798 commit 7b81bb1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/ashutoshSce/minify-html-webpack-plugin)](https://github.com/kangax/html-minifier)
[![NPM](https://img.shields.io/npm/l/minify-html-webpack-plugin)](https://www.npmjs.com/package/minify-html-webpack-plugin)

This is a [webpack](http://webpack.github.io/) plugin that can minimize the HTML with [HTMLMinifier](https://www.npmjs.com/package/html-minifier) for all source directory files and copy into destinations directory during the Webpack build.
This is a [webpack](http://webpack.github.io/) plugin that can minimize the HTML with [HTMLMinifier](https://www.npmjs.com/package/html-minifier) for all source directory files and copy into destinations directory recursively iterating through all subfolders and files during the Webpack build.

Installation
============
Expand Down Expand Up @@ -44,7 +44,7 @@ Add the plugin to your webpack and config as follows:

Optional Add Search And Replace Rules
=================
If need to replace string and then minify it across source files.
If need to replace strings and then do minification across all source files in directoris and sub-directories.

```javascript
const MinifyHtmlWebpackPlugin = require('minify-html-webpack-plugin');
Expand All @@ -62,16 +62,18 @@ If need to replace string and then minify it across source files.
},
searchAndReplace: [
{
search: 'search_string', /* The string, or regular expression, that will be replaced by the new value */
replace: 'replace_string' /* The string to replace the search value with */
/* The string, or regular expression, that will be replaced by the new value */
search: 'search_string',
/* The string to replace the search value with */
replace: 'replace_string'
}
]
});
]
};
```

If need to replace array of string with common replace funtions and then minify it across source files.
If need to replace array of string with common replace funtions and then minify it across source files and sub-directories.

```javascript
const MinifyHtmlWebpackPlugin = require('minify-html-webpack-plugin');
Expand Down Expand Up @@ -118,7 +120,7 @@ If need to replace array of string with common replace funtions and then minify

Laravel Mix Users
=================
Paste below snippets into mix.js file.
Paste below snippets into webpack.mix.js file.

```javascript
const MinifyHtmlWebpackPlugin = require('minify-html-webpack-plugin');
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minify-html-webpack-plugin",
"version": "1.1.5",
"version": "1.1.6",
"description": "A webpack plugin to minify html file(s) after building",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -9,7 +9,7 @@
"html-minifier": "^4.0.0"
},
"peerDependencies": {
"webpack": "^2.0.0 || ^3.0.0 || ^4.0.0"
"webpack": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 7b81bb1

Please sign in to comment.