1- import os from 'os' ;
1+ import os from "os" ;
22
3- import { validate } from ' schema-utils' ;
4- import serialize from ' serialize-javascript' ;
5- import HtmlMinimizerPackageJson from ' html-minifier-terser/package.json' ;
6- import pLimit from ' p-limit' ;
7- import Worker from ' jest-worker' ;
3+ import { validate } from " schema-utils" ;
4+ import serialize from " serialize-javascript" ;
5+ import HtmlMinimizerPackageJson from " html-minifier-terser/package.json" ;
6+ import pLimit from " p-limit" ;
7+ import Worker from " jest-worker" ;
88
9- import schema from ' ./options.json' ;
9+ import schema from " ./options.json" ;
1010
11- import { minify as minifyFn } from ' ./minify' ;
11+ import { minify as minifyFn } from " ./minify" ;
1212
1313class HtmlMinimizerPlugin {
1414 constructor ( options = { } ) {
1515 validate ( schema , options , {
16- name : ' Html Minimizer Plugin' ,
17- baseDataPath : ' options' ,
16+ name : " Html Minimizer Plugin" ,
17+ baseDataPath : " options" ,
1818 } ) ;
1919
2020 const {
@@ -53,7 +53,7 @@ class HtmlMinimizerPlugin {
5353 }
5454
5555 async optimize ( compiler , compilation , assets , optimizeOptions ) {
56- const cache = compilation . getCache ( ' HtmlMinimizerWebpackPlugin' ) ;
56+ const cache = compilation . getCache ( " HtmlMinimizerWebpackPlugin" ) ;
5757 let numberOfAssetsForMinify = 0 ;
5858 const assetsForMinify = await Promise . all (
5959 Object . keys ( assets )
@@ -108,7 +108,7 @@ class HtmlMinimizerPlugin {
108108 return initializedWorker ;
109109 }
110110
111- initializedWorker = new Worker ( require . resolve ( ' ./minify' ) , {
111+ initializedWorker = new Worker ( require . resolve ( " ./minify" ) , {
112112 numWorkers : numberOfWorkers ,
113113 enableWorkerThreads : true ,
114114 } ) ;
@@ -117,15 +117,15 @@ class HtmlMinimizerPlugin {
117117 const workerStdout = initializedWorker . getStdout ( ) ;
118118
119119 if ( workerStdout ) {
120- workerStdout . on ( ' data' , ( chunk ) => {
120+ workerStdout . on ( " data" , ( chunk ) => {
121121 return process . stdout . write ( chunk ) ;
122122 } ) ;
123123 }
124124
125125 const workerStderr = initializedWorker . getStderr ( ) ;
126126
127127 if ( workerStderr ) {
128- workerStderr . on ( ' data' , ( chunk ) => {
128+ workerStderr . on ( " data" , ( chunk ) => {
129129 return process . stderr . write ( chunk ) ;
130130 } ) ;
131131 }
@@ -216,7 +216,7 @@ class HtmlMinimizerPlugin {
216216 } ) ;
217217
218218 hooks . chunkHash . tap ( pluginName , ( chunk , hash ) => {
219- hash . update ( ' HtmlMinimizerPlugin' ) ;
219+ hash . update ( " HtmlMinimizerPlugin" ) ;
220220 hash . update ( data ) ;
221221 } ) ;
222222
@@ -234,12 +234,12 @@ class HtmlMinimizerPlugin {
234234
235235 compilation . hooks . statsPrinter . tap ( pluginName , ( stats ) => {
236236 stats . hooks . print
237- . for ( ' asset.info.minimized' )
237+ . for ( " asset.info.minimized" )
238238 . tap (
239- ' html-minimizer-webpack-plugin' ,
239+ " html-minimizer-webpack-plugin" ,
240240 ( minimized , { green, formatFlag } ) =>
241241 // eslint-disable-next-line no-undefined
242- minimized ? green ( formatFlag ( ' minimized' ) ) : undefined
242+ minimized ? green ( formatFlag ( " minimized" ) ) : undefined
243243 ) ;
244244 } ) ;
245245 } ) ;
0 commit comments