Skip to content

Commit 0b53fa2

Browse files
committed
fix: resolve or error inputs file, close #313
1 parent 4360836 commit 0b53fa2

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/cfg-resolve.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,17 @@ export default ({input, flags = {}}) => {
1919
({config} = explorer.search());
2020
}
2121

22+
input = []
23+
.concat(input || config?.input)
24+
.filter(Boolean)
25+
.map(file => path.join(path.resolve(root), file));
26+
27+
if (input.length === 0) {
28+
throw new TypeError('input files not found');
29+
}
30+
2231
return mergeOptions(config || {}, {
23-
input: [].concat(input).map(file => path.join(path.resolve(root), file)),
32+
input,
2433
output,
2534
options,
2635
root,

0 commit comments

Comments
 (0)