aboutsummaryrefslogtreecommitdiff
path: root/integration
diff options
context:
space:
mode:
Diffstat (limited to 'integration')
-rw-r--r--integration/scripts/browser.js2
-rw-r--r--integration/snapshots-no-hmr/ts-fallback-rewrite-works.js3
-rw-r--r--integration/snapshots-no-hmr/tsx-fallback-rewrite-works.js3
-rw-r--r--integration/snapshots/ts-fallback-rewrite-works.js25
-rw-r--r--integration/snapshots/tsx-fallback-rewrite-works.js25
-rw-r--r--integration/snippets/ts-fallback-rewrite-works.ts5
-rw-r--r--integration/snippets/tsx-fallback-rewrite-works.tsx5
7 files changed, 68 insertions, 0 deletions
diff --git a/integration/scripts/browser.js b/integration/scripts/browser.js
index 86e342d8c..a37e6e2a2 100644
--- a/integration/scripts/browser.js
+++ b/integration/scripts/browser.js
@@ -92,6 +92,8 @@ async function main() {
"/type-only-imports.ts",
"/global-is-remapped-to-globalThis.js",
"/multiple-imports.js",
+ "/ts-fallback-rewrite-works.js",
+ "/tsx-fallback-rewrite-works.js",
];
for (let test of tests) {
diff --git a/integration/snapshots-no-hmr/ts-fallback-rewrite-works.js b/integration/snapshots-no-hmr/ts-fallback-rewrite-works.js
new file mode 100644
index 000000000..a4e489f28
--- /dev/null
+++ b/integration/snapshots-no-hmr/ts-fallback-rewrite-works.js
@@ -0,0 +1,3 @@
+export function test() {
+ return testDone(import.meta.url);
+}
diff --git a/integration/snapshots-no-hmr/tsx-fallback-rewrite-works.js b/integration/snapshots-no-hmr/tsx-fallback-rewrite-works.js
new file mode 100644
index 000000000..a4e489f28
--- /dev/null
+++ b/integration/snapshots-no-hmr/tsx-fallback-rewrite-works.js
@@ -0,0 +1,3 @@
+export function test() {
+ return testDone(import.meta.url);
+}
diff --git a/integration/snapshots/ts-fallback-rewrite-works.js b/integration/snapshots/ts-fallback-rewrite-works.js
new file mode 100644
index 000000000..e728c5f14
--- /dev/null
+++ b/integration/snapshots/ts-fallback-rewrite-works.js
@@ -0,0 +1,25 @@
+import {
+__HMRModule as HMR
+} from "http://localhost:8080/__runtime.js";
+import {
+__HMRClient as Bun
+} from "http://localhost:8080/__runtime.js";
+Bun.activate(false);
+
+var hmr = new HMR(421762902, "ts-fallback-rewrite-works.ts"), exports = hmr.exports;
+(hmr._load = function() {
+ function test() {
+ return testDone(import.meta.url);
+ }
+ hmr.exportAll({
+ test: () => test
+ });
+})();
+var $$hmr_test = hmr.exports.test;
+hmr._update = function(exports) {
+ $$hmr_test = exports.test;
+};
+
+export {
+ $$hmr_test as test
+};
diff --git a/integration/snapshots/tsx-fallback-rewrite-works.js b/integration/snapshots/tsx-fallback-rewrite-works.js
new file mode 100644
index 000000000..3f2f754e2
--- /dev/null
+++ b/integration/snapshots/tsx-fallback-rewrite-works.js
@@ -0,0 +1,25 @@
+import {
+__HMRModule as HMR
+} from "http://localhost:8080/__runtime.js";
+import {
+__HMRClient as Bun
+} from "http://localhost:8080/__runtime.js";
+Bun.activate(false);
+
+var hmr = new HMR(2117426367, "tsx-fallback-rewrite-works.tsx"), exports = hmr.exports;
+(hmr._load = function() {
+ function test() {
+ return testDone(import.meta.url);
+ }
+ hmr.exportAll({
+ test: () => test
+ });
+})();
+var $$hmr_test = hmr.exports.test;
+hmr._update = function(exports) {
+ $$hmr_test = exports.test;
+};
+
+export {
+ $$hmr_test as test
+};
diff --git a/integration/snippets/ts-fallback-rewrite-works.ts b/integration/snippets/ts-fallback-rewrite-works.ts
new file mode 100644
index 000000000..8e6dabcdb
--- /dev/null
+++ b/integration/snippets/ts-fallback-rewrite-works.ts
@@ -0,0 +1,5 @@
+// This looks like it does nothing
+// But if you import /ts-fallback-rewrite-works.js, it should resolve the import to /ts-fallback-rewrite-works.ts
+export function test() {
+ return testDone(import.meta.url);
+}
diff --git a/integration/snippets/tsx-fallback-rewrite-works.tsx b/integration/snippets/tsx-fallback-rewrite-works.tsx
new file mode 100644
index 000000000..b18619914
--- /dev/null
+++ b/integration/snippets/tsx-fallback-rewrite-works.tsx
@@ -0,0 +1,5 @@
+// This looks like it does nothing
+// But if you import /tsx-fallback-rewrite-works.js, it should resolve the import to /tsx-fallback-rewrite-works.tsx
+export function test() {
+ return testDone(import.meta.url);
+}