summaryrefslogtreecommitdiff
path: root/tests/specs/run/cjs_reexport_non_analyzable/main.ts
diff options
context:
space:
mode:
authorNathan Whitaker <17734409+nathanwhit@users.noreply.github.com>2024-09-19 18:37:36 -0700
committerGitHub <noreply@github.com>2024-09-19 18:37:36 -0700
commitf1ba26661346a83b6e7fe5e7ffeed4553a9571ae (patch)
tree2aaa1c5fa8896b0dddb3219f627f32e3ad73afcc /tests/specs/run/cjs_reexport_non_analyzable/main.ts
parent5bcea1a9f4eb95cd764047869a17ed74df8f60d1 (diff)
fix(node): Don't error out if we fail to statically analyze CJS re-export (#25748)
Fixes rsbuild running in deno. You can look at the test to see what was failing, the gist is that we were trying to statically analyze the re-exports of a CJS script, and if we couldn't find the source for the re-exported file we would fail. Instead, we should just treat these as if they were too dynamic to analyze, and let it fail (or succeed) at runtime. This aligns with node's behavior.
Diffstat (limited to 'tests/specs/run/cjs_reexport_non_analyzable/main.ts')
-rw-r--r--tests/specs/run/cjs_reexport_non_analyzable/main.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/specs/run/cjs_reexport_non_analyzable/main.ts b/tests/specs/run/cjs_reexport_non_analyzable/main.ts
new file mode 100644
index 000000000..a9e32af4e
--- /dev/null
+++ b/tests/specs/run/cjs_reexport_non_analyzable/main.ts
@@ -0,0 +1,3 @@
+import assert from "./node_modules/foo.cjs";
+
+assert.equal(1 + 1, 2);