@impakers/debug 1.3.12 → 1.3.13
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/dist/react.js +9 -2
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +9 -2
- package/dist/react.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -2139,28 +2139,35 @@ async function getSourceMapUrlFromBundle(bundleUrl) {
|
|
|
2139
2139
|
async function loadSourceMap(bundleUrl) {
|
|
2140
2140
|
if (cache2.has(bundleUrl)) return cache2.get(bundleUrl) ?? null;
|
|
2141
2141
|
if (failedUrls.has(bundleUrl)) return null;
|
|
2142
|
+
const debugLog = typeof window !== "undefined" && window.__IMPAKERS_DEBUG_LOG;
|
|
2142
2143
|
const directMapUrl = bundleUrl.endsWith(".map") ? bundleUrl : `${bundleUrl}.map`;
|
|
2143
2144
|
try {
|
|
2144
2145
|
const res = await fetch(directMapUrl, { cache: "force-cache" });
|
|
2146
|
+
if (debugLog) console.log("[impakers-debug] 1\uCC28 .map fetch:", res.status, directMapUrl);
|
|
2145
2147
|
if (res.ok) {
|
|
2146
2148
|
const rawMap = await res.json();
|
|
2147
2149
|
const traceMap = new import_trace_mapping.AnyMap(rawMap);
|
|
2148
2150
|
cache2.set(bundleUrl, traceMap);
|
|
2149
2151
|
return traceMap;
|
|
2150
2152
|
}
|
|
2151
|
-
} catch {
|
|
2153
|
+
} catch (e) {
|
|
2154
|
+
if (debugLog) console.log("[impakers-debug] 1\uCC28 .map fetch exception:", e);
|
|
2152
2155
|
}
|
|
2156
|
+
if (debugLog) console.log("[impakers-debug] 2\uCC28 \uC2DC\uB3C4: JS\uC5D0\uC11C sourceMappingURL \uCD94\uCD9C...");
|
|
2153
2157
|
const actualMapUrl = await getSourceMapUrlFromBundle(bundleUrl);
|
|
2158
|
+
if (debugLog) console.log("[impakers-debug] 2\uCC28 actualMapUrl:", actualMapUrl);
|
|
2154
2159
|
if (actualMapUrl) {
|
|
2155
2160
|
try {
|
|
2156
2161
|
const res = await fetch(actualMapUrl, { cache: "force-cache" });
|
|
2162
|
+
if (debugLog) console.log("[impakers-debug] 2\uCC28 .map fetch:", res.status, actualMapUrl);
|
|
2157
2163
|
if (res.ok) {
|
|
2158
2164
|
const rawMap = await res.json();
|
|
2159
2165
|
const traceMap = new import_trace_mapping.AnyMap(rawMap);
|
|
2160
2166
|
cache2.set(bundleUrl, traceMap);
|
|
2161
2167
|
return traceMap;
|
|
2162
2168
|
}
|
|
2163
|
-
} catch {
|
|
2169
|
+
} catch (e) {
|
|
2170
|
+
if (debugLog) console.log("[impakers-debug] 2\uCC28 .map fetch exception:", e);
|
|
2164
2171
|
}
|
|
2165
2172
|
}
|
|
2166
2173
|
failedUrls.add(bundleUrl);
|