File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,17 @@ class HTMLValidatePlugin {
77 {
88 // default values
99 path : 'src/**/*' ,
10- extensions : 'html' ,
11- config : '.htmlvalidate' ,
10+ extensions : [ 'html' ] ,
11+ config : false ,
1212 global : false ,
1313 } ,
14- // destructure params
1514 ( {
15+ // destructure params
1616 path : this . path ,
1717 extensions : this . extensions ,
1818 config : this . config ,
1919 global : this . global ,
20+ // user provided params override defaults
2021 } = options )
2122 ) ;
2223 }
@@ -44,12 +45,10 @@ class HTMLValidatePlugin {
4445 apply ( compiler ) {
4546 // initiate script when webpack compilation is completed
4647 compiler . hooks . done . tap ( 'HTMLValidatePlugin' , ( ) => {
47- const path = `${ this . path || 'src/**/*' } ` ;
48- const extension = `${ this . convertExtensionArrayToRegex ( ) } ` ;
49- const config = `${ '--config ' + this . config + '.json' } ` ;
50-
5148 // set up cli payload
52- const userParams = `${ path } .${ extension } ${ config } ` ;
49+ const userParams = `${ this . path } .${ this . convertExtensionArrayToRegex ( ) } ${
50+ this . config ? '--config ' + this . config + '.json' : this . config
51+ } `;
5352 const spawnParams = {
5453 shell : true ,
5554 /*inherit color output */ stdio : 'inherit' ,
You can’t perform that action at this time.
0 commit comments