rwsdk 1.0.0 → 1.0.1
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.
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { getManifest } from "../lib/manifest.js";
|
|
3
|
+
// context(justinvdm, 2026-03-15): See toManifestKey in stylesheets.tsx for
|
|
4
|
+
// why we strip the leading slash.
|
|
5
|
+
const toManifestKey = (id) => (id.startsWith("/") ? id.slice(1) : id);
|
|
3
6
|
export function findScriptForModule(id, manifest) {
|
|
4
7
|
const visited = new Set();
|
|
5
8
|
function find(id) {
|
|
@@ -7,7 +10,7 @@ export function findScriptForModule(id, manifest) {
|
|
|
7
10
|
return;
|
|
8
11
|
}
|
|
9
12
|
visited.add(id);
|
|
10
|
-
const manifestEntry = manifest[id];
|
|
13
|
+
const manifestEntry = manifest[toManifestKey(id)];
|
|
11
14
|
if (!manifestEntry) {
|
|
12
15
|
return;
|
|
13
16
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { getManifest } from "../lib/manifest.js";
|
|
3
|
+
// context(justinvdm, 2026-03-15): Vite's client manifest uses keys without
|
|
4
|
+
// a leading slash (e.g. "src/app/pages/Welcome.tsx"), but our module IDs in
|
|
5
|
+
// scriptsToBeLoaded use Vite-style leading-slash paths (e.g.
|
|
6
|
+
// "/src/app/pages/Welcome.tsx") from normalizeModulePath. We strip the
|
|
7
|
+
// leading slash here so the lookup succeeds.
|
|
8
|
+
const toManifestKey = (id) => (id.startsWith("/") ? id.slice(1) : id);
|
|
3
9
|
const findCssForModule = (scriptId, manifest) => {
|
|
4
10
|
const css = new Set();
|
|
5
11
|
const visited = new Set();
|
|
@@ -8,7 +14,7 @@ const findCssForModule = (scriptId, manifest) => {
|
|
|
8
14
|
return;
|
|
9
15
|
}
|
|
10
16
|
visited.add(id);
|
|
11
|
-
const entry = manifest[id];
|
|
17
|
+
const entry = manifest[toManifestKey(id)];
|
|
12
18
|
if (!entry) {
|
|
13
19
|
return;
|
|
14
20
|
}
|