Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow sending plugins fn (to get different instances for each router) #1198

Merged
merged 1 commit into from
Dec 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions packages/start/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}),
Expand Down Expand Up @@ -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)))
}),
Expand Down Expand Up @@ -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: {
Expand Down
Loading