Skip to content

Commit 87adb1c

Browse files
author
John Doe
committed
refactor: cfg rolldown 3
1 parent c68258a commit 87adb1c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

packages/utils/src/lib/file-system.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { bold, gray } from 'ansis';
22
import { type Options, bundleRequire } from 'bundle-require';
33
import { mkdir, readFile, readdir, rm, stat } from 'node:fs/promises';
44
import path from 'node:path';
5-
import { pathToFileURL } from 'node:url';
65
import type { Format, PersistConfig } from '@code-pushup/models';
76
import { formatBytes } from './formatting.js';
87
import { logMultipleResults } from './log-results.js';
@@ -78,15 +77,7 @@ export function logMultipleFileResults(
7877
}
7978

8079
export async function importModule<T = unknown>(options: Options): Promise<T> {
81-
// Convert filepath to URL for proper ESM loading on Windows
82-
const filepath = path.isAbsolute(options.filepath)
83-
? pathToFileURL(options.filepath).toString()
84-
: options.filepath;
85-
86-
const { mod } = await bundleRequire<object>({
87-
...options,
88-
filepath,
89-
});
80+
const { mod } = await bundleRequire<object>(options);
9081

9182
if (typeof mod === 'object' && 'default' in mod) {
9283
return mod.default as T;

0 commit comments

Comments
 (0)