We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
url.pathToFileURL
1 parent 94fd41d commit f75cc49Copy full SHA for f75cc49
resources/benchmark.ts
@@ -376,10 +376,13 @@ interface BenchmarkSample {
376
}
377
378
function sampleModule(modulePath: string): BenchmarkSample {
379
+ // To support Windows we need to use URL instead of path
380
+ const moduleURL = url.pathToFileURL(modulePath);
381
+
382
const sampleCode = `
383
import fs from 'node:fs';
384
- import { benchmark } from '${url.pathToFileURL(modulePath)}';
385
+ import { benchmark } from '${moduleURL}';
386
387
// warm up, it looks like 7 is a magic number to reliably trigger JIT
388
benchmark.measure();
0 commit comments