Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/document.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ import { registerFile } from '#fs';
// (CommonJS output) or pointing at a bundle with no `standard-fonts/` directory
// next to it (ESM output). Neither may fail before a document actually asks for
// a standard font, so the lookup falls back to a base createRequire accepts and
// a failed lookup explains itself.
const require = createRequire(import.meta.url ?? 'file:///');
// a failed lookup explains itself. The base is the root path `/`, which is
// absolute on every platform; the URL `file:///` has no drive letter, so
// createRequire rejects it on Windows.
const require = createRequire(import.meta.url ?? '/');

const loaders = {
Courier: () => require('./standard-fonts/Courier.cjs'),
Expand Down
Loading