Skip to content

Commit

Permalink
fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Jul 11, 2024
1 parent aae0f34 commit dd1a2a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class Environment {
}

async load(file: string, from?: string): Promise<Template> {
const path = this.options.loader.resolve(from || ".", file);
const path = this.options.loader.resolve(from || "", file);

if (!this.cache.has(path)) {
// Remove query and hash params from path before loading
Expand Down
4 changes: 4 additions & 0 deletions src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export class FileLoader implements Loader {
return path.join(path.dirname(from), file);
}

if (file.startsWith(this.#root)) {
return file;
}

return path.join(this.#root, file);
}
}

0 comments on commit dd1a2a2

Please sign in to comment.