@pylonsync/sdk 0.11.5 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +9 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1166,11 +1166,19 @@ export async function discoverAppRoutes(opts?: {
|
|
|
1166
1166
|
|
|
1167
1167
|
// Resolve the first existing `<base>.{tsx,ts,jsx,js}` in `dir` and
|
|
1168
1168
|
// return it as a cwd-relative, extension-less module path (or null).
|
|
1169
|
+
// Component paths always use "/", on Windows too: they are manifest keys,
|
|
1170
|
+
// client-bundle import specifiers, and the input to the SSR runtime's
|
|
1171
|
+
// boundary walk, all of which split on "/".
|
|
1169
1172
|
const findModule = (dir: string, base: string): string | null => {
|
|
1170
1173
|
const hit = [`${base}.tsx`, `${base}.ts`, `${base}.jsx`, `${base}.js`]
|
|
1171
1174
|
.map((n: string) => path.join(dir, n))
|
|
1172
1175
|
.find((p: string) => fs.existsSync(p));
|
|
1173
|
-
return hit
|
|
1176
|
+
return hit
|
|
1177
|
+
? path
|
|
1178
|
+
.relative(cwd, hit)
|
|
1179
|
+
.replace(/\.(tsx?|jsx?)$/, "")
|
|
1180
|
+
.replace(/\\/g, "/")
|
|
1181
|
+
: null;
|
|
1174
1182
|
};
|
|
1175
1183
|
|
|
1176
1184
|
function walk(dir: string, segments: string[], layouts: string[]): void {
|