Skip to content

Commit 2447d87

Browse files
committed
fix: resolve path on window, close #323
1 parent 27c8748 commit 2447d87

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/cfg-resolve.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import path from 'path';
22
import {cosmiconfigSync} from 'cosmiconfig';
33
import toCamelCase from 'to-camel-case';
44
import mergeOptions from 'merge-options';
5+
import normalizePath from 'normalize-path';
56

67
export default ({input, flags = {}}) => {
78
const explorer = cosmiconfigSync('posthtml');
@@ -69,16 +70,21 @@ export default ({input, flags = {}}) => {
6970
file = file.slice(1);
7071
}
7172

72-
return path.join(ignoreSymbol, path.resolve(root), file);
73+
return `${ignoreSymbol}${normalizePath(path.join(path.resolve(root), file))}`;
7374
});
7475

7576
if (input.length === 0) {
7677
throw new TypeError('input files not found');
7778
}
7879

80+
output = output ?? config?.output;
81+
if (output) {
82+
output = normalizePath(output);
83+
}
84+
7985
return mergeOptions(config ?? {}, {
8086
input,
81-
output: output ?? config?.output,
87+
output,
8288
options,
8389
root,
8490
allInOutput

0 commit comments

Comments
 (0)