@marko/vite 5.3.6 → 5.3.7
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/index.mjs +14 -10
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -851,15 +851,19 @@ function markoPlugin(opts = {}) {
|
|
|
851
851
|
let hydrateConfig;
|
|
852
852
|
const resolveVirtualDependency = (from, dep) => {
|
|
853
853
|
const normalizedFrom = normalizePath(from);
|
|
854
|
-
const query = `${virtualFileQuery}&id=${
|
|
854
|
+
const query = `${virtualFileQuery}&id=${dep.virtualPath.replace(/^\.\//, "").replace(/[^a-z0-9_.-]+/gi, "_")}`;
|
|
855
855
|
const id = normalizedFrom + query;
|
|
856
|
+
const virtualFile = {
|
|
857
|
+
code: dep.code,
|
|
858
|
+
map: stripSourceRoot(dep.map)
|
|
859
|
+
};
|
|
856
860
|
if (devServer) {
|
|
857
861
|
const prev = virtualFiles.get(id);
|
|
858
862
|
if (isDeferredPromise(prev)) {
|
|
859
|
-
prev.resolve(
|
|
863
|
+
prev.resolve(virtualFile);
|
|
860
864
|
}
|
|
861
865
|
}
|
|
862
|
-
virtualFiles.set(id,
|
|
866
|
+
virtualFiles.set(id, virtualFile);
|
|
863
867
|
return `./${path6.posix.basename(normalizedFrom) + query}`;
|
|
864
868
|
};
|
|
865
869
|
let root;
|
|
@@ -1401,7 +1405,7 @@ function markoPlugin(opts = {}) {
|
|
|
1401
1405
|
);
|
|
1402
1406
|
return {
|
|
1403
1407
|
code: code2,
|
|
1404
|
-
map:
|
|
1408
|
+
map: stripSourceRoot(map),
|
|
1405
1409
|
meta: { arcSourceCode: source, arcScanIds: meta2.analyzedTags }
|
|
1406
1410
|
};
|
|
1407
1411
|
}
|
|
@@ -1437,7 +1441,7 @@ if (import.meta.hot) import.meta.hot.accept(() => {});`;
|
|
|
1437
1441
|
}
|
|
1438
1442
|
return {
|
|
1439
1443
|
code,
|
|
1440
|
-
map:
|
|
1444
|
+
map: stripSourceRoot(compiled.map),
|
|
1441
1445
|
meta: isBuild ? { arcSourceCode: source, arcScanIds: meta.analyzedTags } : void 0
|
|
1442
1446
|
};
|
|
1443
1447
|
}
|
|
@@ -1654,11 +1658,11 @@ function getKnownTemplates(cwd) {
|
|
|
1654
1658
|
}
|
|
1655
1659
|
return knownTemplates;
|
|
1656
1660
|
}
|
|
1657
|
-
function
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1661
|
+
function stripSourceRoot(map) {
|
|
1662
|
+
if (map && map.sourceRoot) {
|
|
1663
|
+
map.sourceRoot = void 0;
|
|
1664
|
+
}
|
|
1665
|
+
return map;
|
|
1662
1666
|
}
|
|
1663
1667
|
export {
|
|
1664
1668
|
markoPlugin as default
|