Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Sep 16, 2023
1 parent c4d9127 commit 5d06c77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/middleware/global_options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { debuglog } from 'node:util';
import path from 'node:path';
import { pathToFileURL } from 'node:url';
import {
Inject, ApplicationLifecycle, LifecycleHook, LifecycleHookUnit,
Program, CommandContext,
Expand Down Expand Up @@ -108,7 +109,8 @@ export default class implements ApplicationLifecycle {
if (process.platform === 'win32') {
// ES Module loading with abolute path fails on windows
// https://github.com/nodejs/node/issues/31710#issuecomment-583916239
esmLoader = `file://${esmLoader}`;
// https://nodejs.org/api/url.html#url_url_pathtofileurl_path
esmLoader = pathToFileURL(esmLoader).href;
}
addNodeOptionsToEnv(`--loader ${esmLoader}`, ctx.env);
}
Expand Down

0 comments on commit 5d06c77

Please sign in to comment.