|
1 | 1 | import path from "node:path"; |
2 | | -import type { Plugin } from "vite"; |
| 2 | +import { normalizePath, type Plugin } from "vite"; |
3 | 3 | import rsc from "@vitejs/plugin-rsc"; |
4 | 4 | import { buildApp } from "../build/buildApp"; |
5 | 5 | import { serverPlugin } from "./server"; |
@@ -129,20 +129,28 @@ export default function funstackStatic( |
129 | 129 | name: "@funstack/static:config", |
130 | 130 | configResolved(config) { |
131 | 131 | if (isMultiEntry) { |
132 | | - resolvedEntriesModule = path.resolve(config.root, options.entries); |
| 132 | + resolvedEntriesModule = normalizePath( |
| 133 | + path.resolve(config.root, options.entries), |
| 134 | + ); |
133 | 135 | } else { |
134 | 136 | // For single-entry, we store both resolved paths to generate a |
135 | 137 | // synthetic entries module in the virtual module loader. |
136 | | - const resolvedRoot = path.resolve(config.root, options.root); |
137 | | - const resolvedApp = path.resolve(config.root, options.app); |
| 138 | + const resolvedRoot = normalizePath( |
| 139 | + path.resolve(config.root, options.root), |
| 140 | + ); |
| 141 | + const resolvedApp = normalizePath( |
| 142 | + path.resolve(config.root, options.app), |
| 143 | + ); |
138 | 144 | // Encode as JSON for safe embedding in generated code |
139 | 145 | resolvedEntriesModule = JSON.stringify({ |
140 | 146 | root: resolvedRoot, |
141 | 147 | app: resolvedApp, |
142 | 148 | }); |
143 | 149 | } |
144 | 150 | if (clientInit) { |
145 | | - resolvedClientInitEntry = path.resolve(config.root, clientInit); |
| 151 | + resolvedClientInitEntry = normalizePath( |
| 152 | + path.resolve(config.root, clientInit), |
| 153 | + ); |
146 | 154 | } |
147 | 155 | }, |
148 | 156 | configEnvironment(_name, config) { |
|
0 commit comments