1- import { TanStackServerFnPlugin } from "@tanstack/server-functions-plugin" ;
21import { defu } from "defu" ;
32import { globSync } from "node:fs" ;
43import { extname , isAbsolute , join } from "node:path" ;
5- import { fileURLToPath } from "node:url" ;
6- import { normalizePath , type PluginOption } from "vite" ;
4+ import { type PluginOption } from "vite" ;
75import solid , { type Options as SolidOptions } from "vite-plugin-solid" ;
8-
6+ import { serverFunctionsPlugin } from "../directives/index.ts" ;
97import { DEFAULT_EXTENSIONS , VIRTUAL_MODULES , VITE_ENVIRONMENTS } from "./constants.ts" ;
108import { devServer } from "./dev-server.ts" ;
119import { SolidStartClientFileRouter , SolidStartServerFileRouter } from "./fs-router.ts" ;
@@ -14,7 +12,6 @@ import type { BaseFileSystemRouter } from "./fs-routes/router.ts";
1412import lazy from "./lazy.ts" ;
1513import { manifest } from "./manifest.ts" ;
1614import { parseIdQuery } from "./utils.ts" ;
17- import { serverFunctionsPlugin } from "../directives/index.ts" ;
1815
1916export interface SolidStartOptions {
2017 solid ?: Partial < SolidOptions > ;
@@ -167,42 +164,6 @@ export function solidStart(options?: SolidStartOptions): Array<PluginOption> {
167164 serverFunctionsPlugin ( {
168165 manifest : VIRTUAL_MODULES . serverFnManifest ,
169166 } ) ,
170- // // Must be placed after fsRoutes, as treeShake will remove the
171- // // server fn exports added in by this plugin
172- // TanStackServerFnPlugin({
173- // // This is the ID that will be available to look up and import
174- // // our server function manifest and resolve its module
175- // manifestVirtualImportId: VIRTUAL_MODULES.serverFnManifest,
176- // directive: "use server",
177- // callers: [
178- // {
179- // envConsumer: "client",
180- // envName: VITE_ENVIRONMENTS.client,
181- // getRuntimeCode: () =>
182- // `import { createServerReference } from "${normalizePath(
183- // fileURLToPath(new URL("../server/server-runtime", import.meta.url))
184- // )}"`,
185- // replacer: opts => `createServerReference('${opts.functionId}')`,
186- // },
187- // {
188- // envConsumer: "server",
189- // envName: VITE_ENVIRONMENTS.server,
190- // getRuntimeCode: () =>
191- // `import { createServerReference } from '${normalizePath(
192- // fileURLToPath(new URL("../server/server-fns-runtime", import.meta.url))
193- // )}'`,
194- // replacer: opts => `createServerReference(${opts.fn}, '${opts.functionId}')`,
195- // },
196- // ],
197- // provider: {
198- // envName: VITE_ENVIRONMENTS.server,
199- // getRuntimeCode: () =>
200- // `import { createServerReference } from '${normalizePath(
201- // fileURLToPath(new URL("../server/server-fns-runtime", import.meta.url))
202- // )}'`,
203- // replacer: opts => `createServerReference(${opts.fn}, '${opts.functionId}')`,
204- // },
205- // }),
206167 {
207168 name : "solid-start:virtual-modules" ,
208169 async resolveId ( id ) {
0 commit comments