@@ -25,21 +25,28 @@ export default ({input, flags = {}}) => {
25
25
use = [ ] . concat ( use ) . reduce ( ( cfg , name ) => {
26
26
let cliOptions = flags [ toCamelCase ( name ) ] ;
27
27
let configOptions = configPluginOptions [ name ] ;
28
+
28
29
// We merge this way because options can be both strings and objects.
29
- const merged = mergeOptions ( { [ name ] : configOptions } , { [ name ] : cliOptions || { } } ) ;
30
+ const merged = mergeOptions ( { [ name ] : configOptions } , { [ name ] : cliOptions || { } } ) ;
31
+
30
32
// Assigning as we loop `use` makes sure that the order in cfg.plugins is correct.
31
33
cfg . plugins [ name ] = merged [ name ] ;
34
+
32
35
if ( configOptions ) {
33
36
delete configPluginOptions [ name ] ;
34
37
}
38
+
35
39
return cfg ;
36
- } , { plugins : { } } ) ;
40
+ } , { plugins : { } } ) ;
37
41
38
42
// Add the remaining plugins if there is any.
39
43
if ( config && config . plugins ) {
40
44
for ( let name in configPluginOptions ) {
41
- use . plugins [ name ] = configPluginOptions [ name ] ;
45
+ if ( configPluginOptions [ name ] ) {
46
+ use . plugins [ name ] = configPluginOptions [ name ] ;
47
+ }
42
48
}
49
+
43
50
// Now all the plugins are in `use.plugins`.
44
51
// Delete `config.plugins` for correct merging later: mergeOptions(config, {...}, use)
45
52
delete config . plugins ;
@@ -53,7 +60,17 @@ export default ({input, flags = {}}) => {
53
60
input = [ ]
54
61
. concat ( input && input . length > 0 ? input : config ?. input )
55
62
. filter ( Boolean )
56
- . map ( file => path . join ( path . resolve ( root ) , file ) ) ;
63
+ . map ( file => {
64
+ const ignoreFile = file . startsWith ( '!' ) ;
65
+ let ignoreSymbol = '' ;
66
+
67
+ if ( ignoreFile ) {
68
+ ignoreSymbol = '!' ;
69
+ file = file . slice ( 1 ) ;
70
+ }
71
+
72
+ return path . join ( ignoreSymbol , path . resolve ( root ) , file ) ;
73
+ } ) ;
57
74
58
75
if ( input . length === 0 ) {
59
76
throw new TypeError ( 'input files not found' ) ;
0 commit comments