@marko/vite 4.1.6 → 4.1.8
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 +13 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -900,21 +900,22 @@ function markoPlugin(opts = {}) {
|
|
|
900
900
|
configureServer(_server) {
|
|
901
901
|
ssrConfig.hot = domConfig.hot = true;
|
|
902
902
|
devServer = _server;
|
|
903
|
-
devServer.watcher.on("all", (type,
|
|
904
|
-
|
|
903
|
+
devServer.watcher.on("all", (type, originalFileName) => {
|
|
904
|
+
const fileName = normalizePath(originalFileName);
|
|
905
|
+
cachedSources.delete(fileName);
|
|
905
906
|
if (type === "unlink") {
|
|
906
|
-
entryIds.delete(
|
|
907
|
-
transformWatchFiles.delete(
|
|
908
|
-
transformOptionalFiles.delete(
|
|
907
|
+
entryIds.delete(fileName);
|
|
908
|
+
transformWatchFiles.delete(fileName);
|
|
909
|
+
transformOptionalFiles.delete(fileName);
|
|
909
910
|
}
|
|
910
911
|
for (const [id, files] of transformWatchFiles) {
|
|
911
|
-
if (anyMatch(files,
|
|
912
|
+
if (anyMatch(files, fileName)) {
|
|
912
913
|
devServer.watcher.emit("change", id);
|
|
913
914
|
}
|
|
914
915
|
}
|
|
915
916
|
if (type === "add" || type === "unlink") {
|
|
916
917
|
for (const [id, files] of transformOptionalFiles) {
|
|
917
|
-
if (anyMatch(files,
|
|
918
|
+
if (anyMatch(files, fileName)) {
|
|
918
919
|
devServer.watcher.emit("change", id);
|
|
919
920
|
}
|
|
920
921
|
}
|
|
@@ -1080,7 +1081,11 @@ function markoPlugin(opts = {}) {
|
|
|
1080
1081
|
if (!isBuild) {
|
|
1081
1082
|
const ext = path5.extname(id);
|
|
1082
1083
|
if (ext === ".cjs" || ext === ".js" && isCJSModule(id)) {
|
|
1083
|
-
|
|
1084
|
+
try {
|
|
1085
|
+
return await cjsToEsm(source);
|
|
1086
|
+
} catch {
|
|
1087
|
+
return null;
|
|
1088
|
+
}
|
|
1084
1089
|
}
|
|
1085
1090
|
}
|
|
1086
1091
|
return null;
|