File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -38,17 +38,23 @@ var argv = require('yargs')
38
38
function processing ( file , output ) {
39
39
// get htmls
40
40
var html = fs . readFileSync ( file , 'utf8' )
41
- var ext = { }
41
+
42
+ // config
43
+ var config = { }
42
44
43
45
// create config extends for post-load-plugins
44
46
if ( argv . use ) {
45
47
argv . use . forEach ( function ( plugin ) {
46
- ext [ plugin ] = argv [ plugin ] || { }
48
+ config [ plugin ] = argv [ plugin ] || { }
47
49
} )
48
50
}
49
51
52
+ if ( argv . config ) {
53
+ config = Object . assign ( require ( path . resolve ( argv . config ) ) , config )
54
+ }
55
+
50
56
// processing
51
- posthtml ( require ( 'post-load-plugins' ) ( argv . config , ext ) )
57
+ posthtml ( require ( 'post-load-plugins' ) ( config ) )
52
58
. process ( html )
53
59
. then ( function ( result ) {
54
60
fs . writeFileSync ( output , result . html )
You can’t perform that action at this time.
0 commit comments