From f3bb972a204566f3f5f8e9893c965d34553458e2 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Mon, 20 Apr 2026 06:15:55 +0100 Subject: [PATCH] Ignore test files/folders in bundling --- dist/utils/grab-all-pages.js | 6 ++++++ package.json | 2 +- src/utils/grab-all-pages.ts | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dist/utils/grab-all-pages.js b/dist/utils/grab-all-pages.js index 686a14e..3d5081a 100644 --- a/dist/utils/grab-all-pages.js +++ b/dist/utils/grab-all-pages.js @@ -41,6 +41,12 @@ function grabPageDirRecursively({ page_dir, include_server, }) { if (is_page_excluded) { continue; } + if (full_page_path.match(/__test__/)) { + continue; + } + if (page_name.match(/\.test\.(t|j)sx?/)) { + continue; + } if (page_name.match(/\.server\.tsx?/) && !include_server) { continue; } diff --git a/package.json b/package.json index 4dd43c4..2311113 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/bunext", - "version": "1.0.89", + "version": "1.0.90", "main": "dist/index.js", "module": "index.ts", "dependencies": { diff --git a/src/utils/grab-all-pages.ts b/src/utils/grab-all-pages.ts index a08e0ef..17fa94d 100644 --- a/src/utils/grab-all-pages.ts +++ b/src/utils/grab-all-pages.ts @@ -70,6 +70,14 @@ function grabPageDirRecursively({ continue; } + if (full_page_path.match(/__test__/)) { + continue; + } + + if (page_name.match(/\.test\.(t|j)sx?/)) { + continue; + } + if (page_name.match(/\.server\.tsx?/) && !include_server) { continue; }