Skip to content

Commit

Permalink
fix chunks windows rsc
Browse files Browse the repository at this point in the history
  • Loading branch information
nksaraf committed Sep 25, 2023
1 parent 319d049 commit 9f785d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
34 changes: 13 additions & 21 deletions docs/content/1.guide/1.what-is-a-router.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ A router is a specification for how a group of routes should be handled. Lets ta
- The base path is available as `import.meta.env.BASE_URL`.
::

### `mode`

::list
- The mode of the router.
- Determines how the other parts of the router are interpreted.
- The mode is available as `import.meta.env.ROUTER_MODE`.
::

### `routes`

::list
Expand All @@ -51,12 +43,22 @@ A router is a specification for how a group of routes should be handled. Lets ta

### `plugins`
::list
- List of Vite/Rollup plugins to apply for the router.
::

### `outDir`

::list
- The output directory for the router.
- The build output directory for the router.
- This is a temporary path because eventually the routers are served by the adapter.
::

### `mode`

::list
- The mode of the router.
- Determines how the other parts of the router are interpreted.
- The mode is available as `import.meta.env.ROUTER_MODE`.
::

> Vinxi supports a few router modes out of the box: `"static"`, `"handler"`, `"build"`, `"spa"`. New modes can be added by you too. Lets see how each mode is different?
Expand Down Expand Up @@ -103,12 +105,7 @@ export default createApp({
base: "/",
mode: "handler",
handler: "./ssr-handler.ts",
fs: {
dir: "./routes",
},
compile: {
target: "server"
}
target: "server"
]
});
```
Expand Down Expand Up @@ -148,12 +145,7 @@ export default createApp({
base: "/_build",
mode: "build",
handler: "./client-handler.ts",
fs: {
dir: "./routes",
},
compile: {
target: "server"
}
target: "client"
]
});
```
Expand Down
5 changes: 4 additions & 1 deletion packages/vinxi-references/chunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ function getChunks(app, routerName, modIndex) {
([name, chunk]) => chunk.file.startsWith("c_") && name !== router.handler,
)
.map(([name, chunk], index) => {
const chunkPath = join(router.outDir, router.base, chunk.file);
const chunkPath = join(router.outDir, router.base, chunk.file).replace(
/\\/g,
"/",
);
return `
import * as mod_${index}_${modIndex} from '${chunkPath}';
chunks['${chunk.file}'] = mod_${index}_${modIndex}
Expand Down

0 comments on commit 9f785d3

Please sign in to comment.