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 {
7
7
{
8
8
// default values
9
9
path : 'src/**/*' ,
10
- extensions : 'html' ,
11
- config : '.htmlvalidate' ,
10
+ extensions : [ 'html' ] ,
11
+ config : false ,
12
12
global : false ,
13
13
} ,
14
- // destructure params
15
14
( {
15
+ // destructure params
16
16
path : this . path ,
17
17
extensions : this . extensions ,
18
18
config : this . config ,
19
19
global : this . global ,
20
+ // user provided params override defaults
20
21
} = options )
21
22
) ;
22
23
}
@@ -44,12 +45,10 @@ class HTMLValidatePlugin {
44
45
apply ( compiler ) {
45
46
// initiate script when webpack compilation is completed
46
47
compiler . hooks . done . tap ( 'HTMLValidatePlugin' , ( ) => {
47
- const path = `${ this . path || 'src/**/*' } ` ;
48
- const extension = `${ this . convertExtensionArrayToRegex ( ) } ` ;
49
- const config = `${ '--config ' + this . config + '.json' } ` ;
50
-
51
48
// 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
+ } `;
53
52
const spawnParams = {
54
53
shell : true ,
55
54
/*inherit color output */ stdio : 'inherit' ,
You can’t perform that action at this time.
0 commit comments