feat(vite): error when using Deno global in the browser (#3305)

Related https://github.com/denoland/fresh/issues/3296
This commit is contained in:
Marvin Hagemeister
2025-09-01 19:56:31 +02:00
committed by GitHub
parent 87b213558b
commit ae2a27e174
10 changed files with 101 additions and 8 deletions
@@ -0,0 +1,3 @@
export function Foo() {
return <h1>{Deno.cwd()}</h1>;
}
@@ -0,0 +1,5 @@
import { App, staticFiles } from "@fresh/core";
export const app = new App()
.use(staticFiles())
.fsRoutes();
@@ -0,0 +1,5 @@
import { Foo } from "../islands/Foo.tsx";
export default function Hello() {
return <Foo />;
}
@@ -0,0 +1,6 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
export default defineConfig({
plugins: [fresh()],
});
@@ -0,0 +1,5 @@
import { App, staticFiles } from "@fresh/core";
export const app = new App()
.use(staticFiles())
.fsRoutes();
@@ -0,0 +1,3 @@
export default function Hello() {
return <h1>{Deno.cwd()}</h1>;
}
@@ -0,0 +1,6 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
export default defineConfig({
plugins: [fresh()],
});