feat(vite): check valid imports per environment (#3299)

Fixes https://github.com/denoland/fresh/issues/3296
This commit is contained in:
Marvin Hagemeister
2025-09-01 17:30:30 +02:00
committed by GitHub
parent 5d052c0fdb
commit ff9db336f7
11 changed files with 291 additions and 35 deletions
@@ -0,0 +1,5 @@
import process from "node:process";
export function NodeIsland() {
return <h1>{process.version}</h1>;
}
@@ -0,0 +1,5 @@
import { App, staticFiles } from "@fresh/core";
export const app = new App()
.use(staticFiles())
.fsRoutes();
@@ -0,0 +1,5 @@
import { NodeIsland } from "../islands/NodeIsland.tsx";
export default function Hello() {
return <NodeIsland />;
}
@@ -0,0 +1,6 @@
import { defineConfig } from "vite";
import { fresh } from "@fresh/plugin-vite";
export default defineConfig({
plugins: [fresh()],
});