diff --git a/bench.js b/bench.js index eeb64dd..4ca8224 100644 --- a/bench.js +++ b/bench.js @@ -7,6 +7,7 @@ import colors from "picocolors"; import { readdirSync } from "node:fs"; import { resolve } from "node:path"; import { argv } from "node:process"; +import { pathToFileURL } from "node:url"; const benchmarkType = argv.includes("--theoretical") ? "theoretical" : "applied"; @@ -16,7 +17,7 @@ const benchmarks = readdirSync(resolve("./benchmarks", benchmarkType)).filter( ); console.log(`Running ${benchmarks.length} ${benchmarkType} benchmarks`); for (const file of benchmarks) { - const benchmark = await import(resolve("benchmarks", benchmarkType, file)); + const benchmark = await import(pathToFileURL(resolve("benchmarks", benchmarkType, file))); const obj = benchmark.original; const newObj = benchmark.changed; diff --git a/package.json b/package.json index 7f7e3aa..f001d1e 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "require": "./dist/index.cjs" }, "scripts": { - "build": "tsc --module CommonJS && mv \"dist/index.js\" \"dist/index.cjs\" && mv \"dist/index.d.ts\" \"dist/index.d.cts\" && tsc --module es2020 && prettier -w dist/*", + "build": "tsc --module CommonJS && shx mv \"dist/index.js\" \"dist/index.cjs\" && shx mv \"dist/index.d.ts\" \"dist/index.d.cts\" && tsc --module es2020 && prettier -w dist/*", "test": "npm run build && node --test ./tests/*", "bench": "npm run build && node --expose-gc bench.js", "prepublish": "npm run build" @@ -30,6 +30,7 @@ "mitata": "^1.0.19", "picocolors": "^1.1.1", "prettier": "^3.4.1", + "shx": "^0.4.0", "typescript": "^5.7.2" }, "type": "module",