@webjourney/vite-plugins 1.1.0 → 1.2.0
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/entry-server.d.ts +8 -0
- package/dist/entry-server.d.ts.map +1 -0
- package/dist/entry-server.js +13 -0
- package/package.json +9 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a render function for server-side rendering
|
|
4
|
+
* @param App - The root App component to render
|
|
5
|
+
* @returns A render function that wraps the App in StrictMode and StaticRouter
|
|
6
|
+
*/
|
|
7
|
+
export declare function createServerRenderer(App: ComponentType): (url: string) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=entry-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-server.d.ts","sourceRoot":"","sources":["../src/entry-server.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,OAAO,CAAC;AAGlD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,IAC9B,KAAK,MAAM,6CASnC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StrictMode } from 'react';
|
|
3
|
+
import { StaticRouter } from 'react-router';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a render function for server-side rendering
|
|
6
|
+
* @param App - The root App component to render
|
|
7
|
+
* @returns A render function that wraps the App in StrictMode and StaticRouter
|
|
8
|
+
*/
|
|
9
|
+
export function createServerRenderer(App) {
|
|
10
|
+
return function render(url) {
|
|
11
|
+
return (_jsx(StrictMode, { children: _jsx(StaticRouter, { location: url, children: _jsx(App, {}) }) }));
|
|
12
|
+
};
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webjourney/vite-plugins",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Vite plugins for Webjourney WYSIWYG editing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"./build": {
|
|
14
14
|
"import": "./dist/build.js",
|
|
15
15
|
"types": "./dist/build.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./entry-server": {
|
|
18
|
+
"import": "./dist/entry-server.js",
|
|
19
|
+
"types": "./dist/entry-server.d.ts"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"files": [
|
|
@@ -37,10 +41,14 @@
|
|
|
37
41
|
"@types/node": "^20.0.0",
|
|
38
42
|
"@types/react": "^18.0.0",
|
|
39
43
|
"@types/react-dom": "^18.0.0",
|
|
44
|
+
"react": "^18.0.0",
|
|
45
|
+
"react-router": "^7.0.0",
|
|
40
46
|
"typescript": "^5.8.3",
|
|
41
47
|
"vite": "^5.0.0"
|
|
42
48
|
},
|
|
43
49
|
"peerDependencies": {
|
|
50
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
51
|
+
"react-router": "^6.0.0 || ^7.0.0",
|
|
44
52
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
45
53
|
}
|
|
46
54
|
}
|