wildpig 1.3.0 → 1.3.2
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/package.json +1 -1
- package/public/render.tsx +4 -1
- package/router/ServerDataGuard.tsx +1 -1
- package/scripts/WildPig.tsx +1 -3
- package/public/render.js +0 -28162
package/package.json
CHANGED
package/public/render.tsx
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
2
2
|
import { RouterProvider } from 'react-router';
|
|
3
|
-
import "./tailwindcss4.js";
|
|
4
3
|
import { serverDataStore } from '../store/serverDataStore';
|
|
5
4
|
import { browserRouter } from '../router/index.js';
|
|
6
5
|
|
|
7
6
|
const isDev = process.env.NODE_ENV === 'development';
|
|
8
7
|
|
|
8
|
+
if(typeof window !== 'undefined'){
|
|
9
|
+
await import("./tailwindcss4.js"!);
|
|
10
|
+
}
|
|
11
|
+
|
|
9
12
|
|
|
10
13
|
// 确保在 DOM 加载完成后才进行水合
|
|
11
14
|
document?.addEventListener("DOMContentLoaded", () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react"
|
|
2
2
|
import { matchRoutes, Outlet, useLocation, useNavigate } from "react-router"
|
|
3
3
|
import pageRoutes from "@/router/routes";
|
|
4
|
-
import { serverDataStore } from "
|
|
4
|
+
import { serverDataStore } from "../store/serverDataStore";
|
|
5
5
|
|
|
6
6
|
export const ServerDataGuard = () => {
|
|
7
7
|
const location = useLocation();
|
package/scripts/WildPig.tsx
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import chalk from "chalk";
|
|
2
|
-
// import { routes, metaRoutes } from "./prepareRoutes";
|
|
3
1
|
import { readFileSync } from "node:fs";
|
|
4
2
|
import { getApiRouteModules } from "./apiRoutes";
|
|
5
3
|
import { renderToReadableStream } from "react-dom/server";
|
|
@@ -24,7 +22,7 @@ const isDev = env.NODE_ENV === "development";
|
|
|
24
22
|
const apiModules = await getApiRouteModules(isDev ? "dev" : "prod") as any;
|
|
25
23
|
|
|
26
24
|
|
|
27
|
-
if(isDev){
|
|
25
|
+
if(false && isDev){
|
|
28
26
|
setTimeout(() => {import("../public/render")}, 0);
|
|
29
27
|
/** 打包js */
|
|
30
28
|
await Bun.build({
|