Skip to content

Commit

Permalink
fix: always allow './' and '../' to be relative, even on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
harttle committed Nov 5, 2021
1 parent 3d71d9e commit 44f6b52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fs/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class Loader {
if (options.relativeReference) {
const sep = options.fs.sep
assert(sep, '`fs.sep` is required for relative reference')
const rRelativePath = new RegExp(['.' + sep, '..' + sep].map(prefix => escapeRegex(prefix)).join('|'))
const rRelativePath = new RegExp(['.' + sep, '..' + sep, './', '../'].map(prefix => escapeRegex(prefix)).join('|'))
this.shouldLoadRelative = (referencedFile: string) => rRelativePath.test(referencedFile)
} else {
this.shouldLoadRelative = (referencedFile: string) => false
Expand Down

0 comments on commit 44f6b52

Please sign in to comment.