weifuwu 0.17.0 → 0.17.1
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 +2 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -571,7 +571,7 @@ import { renderToReadableStream } from "react-dom/server";
|
|
|
571
571
|
import * as esbuild from "esbuild";
|
|
572
572
|
import { readdirSync, statSync, existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
573
573
|
import { join, relative, resolve as resolve2, sep, dirname, basename } from "node:path";
|
|
574
|
-
import { pathToFileURL
|
|
574
|
+
import { pathToFileURL } from "node:url";
|
|
575
575
|
import { createHash } from "node:crypto";
|
|
576
576
|
import vm from "node:vm";
|
|
577
577
|
import { createRequire } from "node:module";
|
|
@@ -599,7 +599,6 @@ function useCtx() {
|
|
|
599
599
|
}
|
|
600
600
|
|
|
601
601
|
// tsx-instance.ts
|
|
602
|
-
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
603
602
|
var liveReloadClients = /* @__PURE__ */ new Set();
|
|
604
603
|
function broadcastReload() {
|
|
605
604
|
for (const ws of liveReloadClients) {
|
|
@@ -992,16 +991,13 @@ ${src}`;
|
|
|
992
991
|
publicEnv[`process.env.${key}`] = JSON.stringify(process.env[key]);
|
|
993
992
|
}
|
|
994
993
|
}
|
|
995
|
-
const weifuwuAlias = {
|
|
996
|
-
"weifuwu/react": resolve2(__dirname, "react.ts")
|
|
997
|
-
};
|
|
998
994
|
const result = await esbuild.build({
|
|
999
995
|
stdin: { contents: code, loader: "tsx", resolveDir: pagesDir },
|
|
1000
996
|
bundle: true,
|
|
1001
997
|
format: "esm",
|
|
1002
998
|
jsx: "automatic",
|
|
1003
999
|
jsxImportSource: "react",
|
|
1004
|
-
alias:
|
|
1000
|
+
alias: resolveAliases(),
|
|
1005
1001
|
banner: { js: "self.process={env:{}};" },
|
|
1006
1002
|
define: Object.keys(publicEnv).length > 0 ? publicEnv : void 0,
|
|
1007
1003
|
loader: { ".node": "empty" },
|