owebjs 1.3.8 → 1.3.9
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.
|
@@ -99,7 +99,12 @@ const applyRouteHMR = /* @__PURE__ */ __name(async (oweb, op, workingDir, fallba
|
|
|
99
99
|
success(`Route ${f.method.toUpperCase()}:${f.url} reloaded in ${end}ms`, "HMR");
|
|
100
100
|
} else if (op === "delete-file") {
|
|
101
101
|
const start = Date.now();
|
|
102
|
-
const
|
|
102
|
+
const newFilePath = path2.slice(workingDir.length).replaceAll("\\", "/").slice(0, -3);
|
|
103
|
+
let builded = buildRouteURL(newFilePath);
|
|
104
|
+
if (builded.url.endsWith("/index")) {
|
|
105
|
+
builded.url = builded.url.slice(0, -"/index".length);
|
|
106
|
+
}
|
|
107
|
+
const f = routesCache.find((x) => x.method == builded.method && x.url == builded.url);
|
|
103
108
|
if (f.url in temporaryRequests[f.method.toLowerCase()]) {
|
|
104
109
|
delete temporaryRequests[f.method.toLowerCase()][f.url];
|
|
105
110
|
} else {
|
|
@@ -90,8 +90,10 @@ async function generateFunctionFromTypescript(tsCode, filePath) {
|
|
|
90
90
|
if (resolvedPathForDist.startsWith("src" + path.sep)) {
|
|
91
91
|
resolvedPathForDist = resolvedPathForDist.substring("src".length + 1);
|
|
92
92
|
}
|
|
93
|
-
let jsPath = resolvedPathForDist.replace(/\.(ts|mts|cts)$/, "");
|
|
94
|
-
jsPath
|
|
93
|
+
let jsPath = resolvedPathForDist.replace(/\.(ts|js|mts|cts)$/, ".js");
|
|
94
|
+
if (jsPath.startsWith("dist")) {
|
|
95
|
+
jsPath = jsPath.slice("dist".length + 1);
|
|
96
|
+
}
|
|
95
97
|
const targetDistPath = path.join(tsConfig.outDir, jsPath);
|
|
96
98
|
importNode.value = pathToFileURL(targetDistPath).href;
|
|
97
99
|
}
|