Skip to content

Commit

Permalink
Merge pull request #1198 from solidjs/plugins-api
Browse files Browse the repository at this point in the history
allow sending plugins fn (to get different instances for each router)
  • Loading branch information
nksaraf authored Dec 30, 2023
2 parents 6adbafe + e553aab commit a9b4b05
Showing 1 changed file with 8 additions and 6 deletions.
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

0 comments on commit a9b4b05

Please sign in to comment.