diff --git a/packages/start/config/index.js b/packages/start/config/index.js index 77b95bcf4..bdef6f6c1 100644 --- a/packages/start/config/index.js +++ b/packages/start/config/index.js @@ -80,9 +80,10 @@ export function defineConfig(baseConfig = {}) { routes: solidStartServerFsRouter({ dir: `${start.appRoot}/routes`, extensions }), extensions, target: "server", - plugins: () => [ + plugins: async () => [ config("user", userConfig), - ...plugins, + ...(typeof plugins === "function" ? [...(await plugins())] : plugins), + serverTransform({ runtime: normalize(fileURLToPath(new URL("./server-fns-runtime.jsx", import.meta.url))) }), @@ -121,9 +122,9 @@ export function defineConfig(baseConfig = {}) { }), extensions, target: "browser", - plugins: () => [ + plugins: async () => [ config("user", userConfig), - ...plugins, + ...(typeof plugins === "function" ? [...(await plugins())] : plugins), serverFunctions.client({ runtime: normalize(fileURLToPath(new URL("./server-runtime.jsx", import.meta.url))) }), @@ -161,9 +162,10 @@ export function defineConfig(baseConfig = {}) { handler: normalize(fileURLToPath(new URL("./server-handler.js", import.meta.url))), runtime: normalize(fileURLToPath(new URL("./server-fns-runtime.jsx", import.meta.url))), // routes: solidStartServerFsRouter({ dir: `${start.appRoot}/routes`, extensions }), - plugins: () => [ + plugins: async () => [ config("user", userConfig), - ...plugins, + ...(typeof plugins === "function" ? [...(await plugins())] : plugins), + solid({ ...start.solid, ssr: true, extensions: extensions.map(ext => `.${ext}`) }), config("app-server", { resolve: {