Skip to content

Commit

Permalink
Remove minify option
Browse files Browse the repository at this point in the history
  • Loading branch information
iyonaga committed Oct 16, 2018
1 parent 2b8dc45 commit 15daae4
Show file tree
Hide file tree
Showing 4 changed files with 395 additions and 77 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ plugins: [
<!DOCTYPE html>
<html>
<head>
<title><%= htmlWebpackPlugin.options.title%></title>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<$- include('./_header', {foo: 'foo'}) $>
Expand All @@ -79,10 +79,6 @@ plugins: [
## Options
- `delimiter` — Character to use with angle brackets for open/close (default: `"%"`)

- `minify` — Enable/Disable minification (default: `false`)

- `minifyOptions` — See [html-minifier#options-quick-reference](https://github.com/kangax/html-minifier#options-quick-reference) (default: `{}`)

- `beautify` — Enable/Disable beautification (default: `false`)

- `beautifyOptions` See [js-beautify#options](https://github.com/beautify-web/js-beautify#options) (default: `{}`)
7 changes: 1 addition & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const loaderUtils = require('loader-utils');
const ejs = require('ejs');
const path = require('path');
const htmlmin = require('html-minifier');
const beautifyHtml = require('js-beautify').html;

module.exports = function(content) {
Expand Down Expand Up @@ -30,11 +29,7 @@ module.exports = function(content) {

let template = ejs.render(content, options);

if (options.minify) {
template = htmlmin.minify(template, options.minifyOptions || {});
}

if (!options.minify && options.beautify) {
if (options.beautify) {
template = beautifyHtml(template, options.beautifyOptions || {});
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
},
"dependencies": {
"ejs": "^2.6.1",
"html-minifier": "^3.5.20",
"js-beautify": "^1.8.1",
"loader-utils": "^1.1.0"
},
Expand Down
Loading

0 comments on commit 15daae4

Please sign in to comment.