weifuwu 0.18.16 → 0.18.17
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.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5197,8 +5197,8 @@ function clearCompileCache() {
|
|
|
5197
5197
|
_alias = null;
|
|
5198
5198
|
}
|
|
5199
5199
|
async function compileTsx(path2) {
|
|
5200
|
-
if (cache.has(path2)) return cache.get(path2);
|
|
5201
5200
|
const absPath = resolve3(path2);
|
|
5201
|
+
if (cache.has(absPath)) return cache.get(absPath);
|
|
5202
5202
|
mkdirSync(OUT_DIR, { recursive: true });
|
|
5203
5203
|
const hash = id(absPath);
|
|
5204
5204
|
const outPath = join2(OUT_DIR, hash + ".js");
|
|
@@ -5216,7 +5216,7 @@ async function compileTsx(path2) {
|
|
|
5216
5216
|
allowOverwrite: true
|
|
5217
5217
|
});
|
|
5218
5218
|
const mod = await import(pathToFileURL(outPath).href);
|
|
5219
|
-
cache.set(
|
|
5219
|
+
cache.set(absPath, mod);
|
|
5220
5220
|
return mod;
|
|
5221
5221
|
}
|
|
5222
5222
|
function loadSSRModule(code) {
|
|
@@ -5229,8 +5229,8 @@ function loadSSRModule(code) {
|
|
|
5229
5229
|
return mod.exports;
|
|
5230
5230
|
}
|
|
5231
5231
|
async function compileTsxDev(path2) {
|
|
5232
|
-
if (cache.has(path2)) return cache.get(path2);
|
|
5233
5232
|
const absPath = resolve3(path2);
|
|
5233
|
+
if (cache.has(absPath)) return cache.get(absPath);
|
|
5234
5234
|
const result = await esbuild.build({
|
|
5235
5235
|
entryPoints: { [id(absPath)]: absPath },
|
|
5236
5236
|
format: "cjs",
|
|
@@ -5244,7 +5244,7 @@ async function compileTsxDev(path2) {
|
|
|
5244
5244
|
});
|
|
5245
5245
|
const code = new TextDecoder().decode(result.outputFiles[0].contents);
|
|
5246
5246
|
const mod = loadSSRModule(code);
|
|
5247
|
-
cache.set(
|
|
5247
|
+
cache.set(absPath, mod);
|
|
5248
5248
|
return mod;
|
|
5249
5249
|
}
|
|
5250
5250
|
|