aboutsummaryrefslogtreecommitdiff
path: root/bench/scanner/scan.bun.js
diff options
context:
space:
mode:
Diffstat (limited to 'bench/scanner/scan.bun.js')
-rw-r--r--bench/scanner/scan.bun.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/bench/scanner/scan.bun.js b/bench/scanner/scan.bun.js
new file mode 100644
index 000000000..eb2b09452
--- /dev/null
+++ b/bench/scanner/scan.bun.js
@@ -0,0 +1,21 @@
+import { readFileSync } from "fs";
+const fixture = ["action", "default", "loader"];
+const ITERATIONS = parseInt(process.env.ITERATIONS || "1") || 1;
+
+const transpiler = new Bun.Transpiler({
+ loader: "ts",
+});
+
+console.time("Get exports");
+const file = readFileSync("remix-route.ts", "utf8");
+for (let i = 0; i < ITERATIONS; i++) {
+ const { imports, exports } = transpiler.scan(file);
+
+ for (let j = 0; j < fixture.length; j++) {
+ if (fixture[j] !== exports[j]) {
+ throw new Error("Mismatch");
+ }
+ }
+}
+
+console.timeEnd("Get exports");