tsconfig-replace-paths icon indicating copy to clipboard operation
tsconfig-replace-paths copied to clipboard

Pass patterns with forward-slashes

Open DiegoVictor opened this issue 2 years ago • 0 comments

The globby library doesn't accept backward-slashes on sync function:

Note that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.

Ref: https://github.com/sindresorhus/globby#api

This is the reason to the path replacement doesn't work properly on some Windows consoles/terminals. Windows uses backward slashes:

D:\git\tsconfig-replace-paths\dist/**/*.{js,jsx,ts,tsx}

This PR makes sure to always pass a pattern with forward-slashes:

D:/git/tsconfig-replace-paths/dist/**/*.{js,jsx,ts,tsx}

DiegoVictor avatar Sep 23 '22 21:09 DiegoVictor