vite-react-ssg 0.8.3-beta.2 → 0.8.4
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/README.md +32 -0
- package/dist/client/single-page.cjs +1 -1
- package/dist/client/single-page.mjs +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +3 -3
- package/dist/node/cli.cjs +1 -1
- package/dist/node/cli.mjs +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.mjs +1 -1
- package/dist/shared/{vite-react-ssg.0S4Yj_HC.cjs → vite-react-ssg.B4jDfvXh.cjs} +8 -4
- package/dist/shared/{vite-react-ssg.DH605nuR.mjs → vite-react-ssg.CKcl-j8g.mjs} +6 -3
- package/dist/shared/{vite-react-ssg.DQEe2Gi_.mjs → vite-react-ssg.CfJcpdWF.mjs} +8 -4
- package/dist/shared/{vite-react-ssg.CjMwYAJ_.cjs → vite-react-ssg.Dus0yLsZ.cjs} +7 -4
- package/dist/tanstack.cjs +1 -1
- package/dist/tanstack.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,9 @@ For usage examples, see: [`main`/examples/tanstack/src/main.tsx](https://github.
|
|
|
24
24
|
- [`<ClientOnly/>`](#clientonly)
|
|
25
25
|
- [Document head](#document-head)
|
|
26
26
|
- [Reactive head](#reactive-head)
|
|
27
|
+
- [Redirect](#redirect)
|
|
27
28
|
- [Public Base Path](#public-base-path)
|
|
29
|
+
- [Future config](#future-config)
|
|
28
30
|
- [CSS in JS](#css-in-js)
|
|
29
31
|
- [Critical CSS](#critical-css)
|
|
30
32
|
- [Configuration](#configuration)
|
|
@@ -337,6 +339,36 @@ export default function MyHead() {
|
|
|
337
339
|
}
|
|
338
340
|
```
|
|
339
341
|
|
|
342
|
+
## Redirect
|
|
343
|
+
|
|
344
|
+
You should not use redirect in the loader.
|
|
345
|
+
In vite-react-ssg, the loader only executes during the build process for data fetching.
|
|
346
|
+
If you need to perform a redirect in certain situations, you can use the following method to redirect on the client side:
|
|
347
|
+
|
|
348
|
+
```tsx
|
|
349
|
+
export const routes: RouteRecord[] = [
|
|
350
|
+
{
|
|
351
|
+
path: '/:lng',
|
|
352
|
+
Component: Layout,
|
|
353
|
+
getStaticPaths: () => Object.keys(resources),
|
|
354
|
+
children: [
|
|
355
|
+
// ... some routes
|
|
356
|
+
],
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
path: '/',
|
|
360
|
+
Component: () => {
|
|
361
|
+
const navigate = useNavigate()
|
|
362
|
+
useEffect(() => {
|
|
363
|
+
navigate('/en', { replace: true })
|
|
364
|
+
}, [navigate])
|
|
365
|
+
|
|
366
|
+
return null
|
|
367
|
+
},
|
|
368
|
+
},
|
|
369
|
+
]
|
|
370
|
+
```
|
|
371
|
+
|
|
340
372
|
## Public Base Path
|
|
341
373
|
|
|
342
374
|
Just set `base` in vite.config.ts like:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
const reactHelmetAsync = require('react-helmet-async');
|
|
5
|
-
const ClientOnly = require('../shared/vite-react-ssg.
|
|
5
|
+
const ClientOnly = require('../shared/vite-react-ssg.B4jDfvXh.cjs');
|
|
6
6
|
const state = require('../shared/vite-react-ssg.CjsEygxB.cjs');
|
|
7
7
|
require('react');
|
|
8
8
|
require('react-dom');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { HelmetProvider } from 'react-helmet-async';
|
|
3
|
-
import { r as render, h as hydrate, d as documentReady } from '../shared/vite-react-ssg.
|
|
4
|
-
export { C as ClientOnly, H as Head } from '../shared/vite-react-ssg.
|
|
3
|
+
import { r as render, h as hydrate, d as documentReady } from '../shared/vite-react-ssg.CfJcpdWF.mjs';
|
|
4
|
+
export { C as ClientOnly, H as Head } from '../shared/vite-react-ssg.CfJcpdWF.mjs';
|
|
5
5
|
import { d as deserializeState } from '../shared/vite-react-ssg.C6pK7rvr.mjs';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'react-dom';
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
const reactHelmetAsync = require('react-helmet-async');
|
|
5
5
|
const reactRouterDom = require('react-router-dom');
|
|
6
|
-
const ClientOnly = require('./shared/vite-react-ssg.
|
|
6
|
+
const ClientOnly = require('./shared/vite-react-ssg.B4jDfvXh.cjs');
|
|
7
7
|
const state = require('./shared/vite-react-ssg.CjsEygxB.cjs');
|
|
8
8
|
const path = require('./shared/vite-react-ssg.CFQGqC60.cjs');
|
|
9
9
|
const remixRouter = require('./shared/vite-react-ssg.C2GpVZF1.cjs');
|
|
@@ -88,7 +88,7 @@ function ViteReactSSG(routerOptions, fn, options = {}) {
|
|
|
88
88
|
console.warn("[vite-react-ssg] `ssrWhenDev` option is no longer needed. If you want to use csr, just replace `vite-react-ssg dev` with `vite`.");
|
|
89
89
|
const isClient = typeof window !== "undefined";
|
|
90
90
|
const BASE_URL = routerOptions.basename ?? "/";
|
|
91
|
-
const { v7_startTransition, ...routerFeature } = routerOptions.future ?? {};
|
|
91
|
+
const { v7_startTransition = true, ...routerFeature } = routerOptions.future ?? {};
|
|
92
92
|
async function createRoot(client = false, routePath) {
|
|
93
93
|
const browserRouter = client ? reactRouterDom.createBrowserRouter(
|
|
94
94
|
remixRouter.convertRoutesToDataRoutes(routerOptions.routes, transformStaticLoaderRoute),
|
package/dist/index.d.cts
CHANGED
|
@@ -6,7 +6,13 @@ import { LinkProps, NavLinkProps } from 'react-router-dom';
|
|
|
6
6
|
import 'beasties';
|
|
7
7
|
import 'react-helmet-async';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Please use `Link` from 'react-router-dom' instead.
|
|
11
|
+
*/
|
|
9
12
|
declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Please use `NavLink` from 'react-router-dom' instead.
|
|
15
|
+
*/
|
|
10
16
|
declare const NavLink: React.ForwardRefExoticComponent<NavLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
11
17
|
|
|
12
18
|
declare function ViteReactSSG(routerOptions: RouterOptions, fn?: (context: ViteReactSSGContext<true>) => Promise<void> | void, options?: ViteReactSSGClientOptions): (client?: boolean, routePath?: string) => Promise<ViteReactSSGContext<true>>;
|
package/dist/index.d.mts
CHANGED
|
@@ -6,7 +6,13 @@ import { LinkProps, NavLinkProps } from 'react-router-dom';
|
|
|
6
6
|
import 'beasties';
|
|
7
7
|
import 'react-helmet-async';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Please use `Link` from 'react-router-dom' instead.
|
|
11
|
+
*/
|
|
9
12
|
declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Please use `NavLink` from 'react-router-dom' instead.
|
|
15
|
+
*/
|
|
10
16
|
declare const NavLink: React.ForwardRefExoticComponent<NavLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
11
17
|
|
|
12
18
|
declare function ViteReactSSG(routerOptions: RouterOptions, fn?: (context: ViteReactSSGContext<true>) => Promise<void> | void, options?: ViteReactSSGClientOptions): (client?: boolean, routePath?: string) => Promise<ViteReactSSGContext<true>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,13 @@ import { LinkProps, NavLinkProps } from 'react-router-dom';
|
|
|
6
6
|
import 'beasties';
|
|
7
7
|
import 'react-helmet-async';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Please use `Link` from 'react-router-dom' instead.
|
|
11
|
+
*/
|
|
9
12
|
declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Please use `NavLink` from 'react-router-dom' instead.
|
|
15
|
+
*/
|
|
10
16
|
declare const NavLink: React.ForwardRefExoticComponent<NavLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
11
17
|
|
|
12
18
|
declare function ViteReactSSG(routerOptions: RouterOptions, fn?: (context: ViteReactSSGContext<true>) => Promise<void> | void, options?: ViteReactSSGClientOptions): (client?: boolean, routePath?: string) => Promise<ViteReactSSGContext<true>>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { HelmetProvider } from 'react-helmet-async';
|
|
3
3
|
import { useLinkClickHandler, Link as Link$1, NavLink as NavLink$1, matchRoutes, createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
4
|
-
import { r as render, h as hydrate, d as documentReady } from './shared/vite-react-ssg.
|
|
5
|
-
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.
|
|
4
|
+
import { r as render, h as hydrate, d as documentReady } from './shared/vite-react-ssg.CfJcpdWF.mjs';
|
|
5
|
+
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.CfJcpdWF.mjs';
|
|
6
6
|
import { d as deserializeState } from './shared/vite-react-ssg.C6pK7rvr.mjs';
|
|
7
7
|
import { j as joinUrlSegments, w as withLeadingSlash, s as stripBase } from './shared/vite-react-ssg.CjIppNIS.mjs';
|
|
8
8
|
import { c as convertRoutesToDataRoutes } from './shared/vite-react-ssg.C0y5wbxl.mjs';
|
|
@@ -83,7 +83,7 @@ function ViteReactSSG(routerOptions, fn, options = {}) {
|
|
|
83
83
|
console.warn("[vite-react-ssg] `ssrWhenDev` option is no longer needed. If you want to use csr, just replace `vite-react-ssg dev` with `vite`.");
|
|
84
84
|
const isClient = typeof window !== "undefined";
|
|
85
85
|
const BASE_URL = routerOptions.basename ?? "/";
|
|
86
|
-
const { v7_startTransition, ...routerFeature } = routerOptions.future ?? {};
|
|
86
|
+
const { v7_startTransition = true, ...routerFeature } = routerOptions.future ?? {};
|
|
87
87
|
async function createRoot(client = false, routePath) {
|
|
88
88
|
const browserRouter = client ? createBrowserRouter(
|
|
89
89
|
convertRoutesToDataRoutes(routerOptions.routes, transformStaticLoaderRoute),
|
package/dist/node/cli.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const kolorist = require('kolorist');
|
|
4
4
|
const yargs = require('yargs');
|
|
5
5
|
const helpers = require('yargs/helpers');
|
|
6
|
-
const dev = require('../shared/vite-react-ssg.
|
|
6
|
+
const dev = require('../shared/vite-react-ssg.Dus0yLsZ.cjs');
|
|
7
7
|
const webFetch = require('@remix-run/web-fetch');
|
|
8
8
|
require('node:path');
|
|
9
9
|
require('node:module');
|
package/dist/node/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { gray, bold, red, reset, underline } from 'kolorist';
|
|
2
2
|
import yargs from 'yargs';
|
|
3
3
|
import { hideBin } from 'yargs/helpers';
|
|
4
|
-
import { b as build, d as dev } from '../shared/vite-react-ssg.
|
|
4
|
+
import { b as build, d as dev } from '../shared/vite-react-ssg.CKcl-j8g.mjs';
|
|
5
5
|
import { Headers, Request, Response, fetch, FormData } from '@remix-run/web-fetch';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:module';
|
package/dist/node.cjs
CHANGED
package/dist/node.mjs
CHANGED
|
@@ -27,32 +27,36 @@ const CopyReactDOM = {
|
|
|
27
27
|
};
|
|
28
28
|
const { version, render: reactRender, hydrate: reactHydrate } = CopyReactDOM;
|
|
29
29
|
const isReact18 = Number((version || "").split(".")[0]) > 17;
|
|
30
|
-
|
|
30
|
+
function render(app, container, renderOptions = {}) {
|
|
31
31
|
const { useLegacyRender } = renderOptions;
|
|
32
32
|
if (useLegacyRender || !isReact18) {
|
|
33
33
|
reactRender(app, container);
|
|
34
34
|
} else {
|
|
35
|
-
|
|
35
|
+
CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = true;
|
|
36
|
+
const { createRoot } = CopyReactDOM;
|
|
36
37
|
if (!createRoot) {
|
|
37
38
|
throw new Error("createRoot not found");
|
|
38
39
|
}
|
|
39
40
|
const root = createRoot(container);
|
|
41
|
+
CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = false;
|
|
40
42
|
React__default.startTransition(() => {
|
|
41
43
|
root.render(app);
|
|
42
44
|
});
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
|
|
47
|
+
function hydrate(app, container, renderOptions = {}) {
|
|
46
48
|
const { useLegacyRender } = renderOptions;
|
|
47
49
|
if (useLegacyRender || !isReact18) {
|
|
48
50
|
reactHydrate(app, container);
|
|
49
51
|
} else {
|
|
50
|
-
|
|
52
|
+
CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = true;
|
|
53
|
+
const { hydrateRoot } = CopyReactDOM;
|
|
51
54
|
if (!hydrateRoot) {
|
|
52
55
|
throw new Error("hydrateRoot not found");
|
|
53
56
|
}
|
|
54
57
|
React__default.startTransition(() => {
|
|
55
58
|
hydrateRoot(container, app);
|
|
59
|
+
CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = false;
|
|
56
60
|
});
|
|
57
61
|
}
|
|
58
62
|
}
|
|
@@ -15,7 +15,7 @@ import { once } from 'node:events';
|
|
|
15
15
|
import { c as convertRoutesToDataRoutes } from './vite-react-ssg.C0y5wbxl.mjs';
|
|
16
16
|
import { M as META_CONTAINER_ID } from './vite-react-ssg.B-j07kW6.mjs';
|
|
17
17
|
|
|
18
|
-
const version = "0.8.
|
|
18
|
+
const version = "0.8.4";
|
|
19
19
|
|
|
20
20
|
function buildLog(text, count) {
|
|
21
21
|
console.log(`
|
|
@@ -152,7 +152,7 @@ async function renderHTML({
|
|
|
152
152
|
const attributesStringified = [...node.attributes.map(({ name: { value: name }, value }) => `${name}="${value.value}"`)].join(" ");
|
|
153
153
|
const indexHTMLBefore = indexHTML.slice(0, node.start);
|
|
154
154
|
const indexHTMLAfter = indexHTML.slice(node.end);
|
|
155
|
-
renderedOutput = `${indexHTMLBefore}<${node.name} ${attributesStringified} data-server-rendered="true">${appHTML}</${node.name}>${stateScript}${indexHTMLAfter}`;
|
|
155
|
+
renderedOutput = `${indexHTMLBefore}<${node.name} ${attributesStringified} data-server-rendered="true">${appHTML}</${node.name}>${stateScript}${scriptPlaceHolder}${indexHTMLAfter}`;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
});
|
|
@@ -752,9 +752,11 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
752
752
|
customLogger: clientLogger,
|
|
753
753
|
mode: config.mode
|
|
754
754
|
}));
|
|
755
|
+
let unmock = () => {
|
|
756
|
+
};
|
|
755
757
|
if (mock) {
|
|
756
758
|
const { jsdomGlobal } = await import('../chunks/jsdomGlobal.mjs');
|
|
757
|
-
jsdomGlobal();
|
|
759
|
+
unmock = jsdomGlobal();
|
|
758
760
|
}
|
|
759
761
|
buildLog("Build for server...");
|
|
760
762
|
process.env.VITE_SSG = "true";
|
|
@@ -861,6 +863,7 @@ ${err.stack}`);
|
|
|
861
863
|
`${dim(`${outDir}/`)}${cyan(`static-loader-data-manifest-${hash}.json`.padEnd(15, " "))} ${dim(getSize(staticLoaderDataManifestString))}`
|
|
862
864
|
);
|
|
863
865
|
await fs.remove(join(root, ".vite-react-ssg-temp"));
|
|
866
|
+
unmock();
|
|
864
867
|
const pwaPlugin = config.plugins.find((i) => i.name === "vite-plugin-pwa")?.api;
|
|
865
868
|
if (pwaPlugin && !pwaPlugin.disabled && pwaPlugin.generateSW) {
|
|
866
869
|
buildLog("Regenerate PWA...");
|
|
@@ -8,32 +8,36 @@ const CopyReactDOM = {
|
|
|
8
8
|
};
|
|
9
9
|
const { version, render: reactRender, hydrate: reactHydrate } = CopyReactDOM;
|
|
10
10
|
const isReact18 = Number((version || "").split(".")[0]) > 17;
|
|
11
|
-
|
|
11
|
+
function render(app, container, renderOptions = {}) {
|
|
12
12
|
const { useLegacyRender } = renderOptions;
|
|
13
13
|
if (useLegacyRender || !isReact18) {
|
|
14
14
|
reactRender(app, container);
|
|
15
15
|
} else {
|
|
16
|
-
|
|
16
|
+
CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = true;
|
|
17
|
+
const { createRoot } = CopyReactDOM;
|
|
17
18
|
if (!createRoot) {
|
|
18
19
|
throw new Error("createRoot not found");
|
|
19
20
|
}
|
|
20
21
|
const root = createRoot(container);
|
|
22
|
+
CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = false;
|
|
21
23
|
React.startTransition(() => {
|
|
22
24
|
root.render(app);
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
|
-
|
|
28
|
+
function hydrate(app, container, renderOptions = {}) {
|
|
27
29
|
const { useLegacyRender } = renderOptions;
|
|
28
30
|
if (useLegacyRender || !isReact18) {
|
|
29
31
|
reactHydrate(app, container);
|
|
30
32
|
} else {
|
|
31
|
-
|
|
33
|
+
CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = true;
|
|
34
|
+
const { hydrateRoot } = CopyReactDOM;
|
|
32
35
|
if (!hydrateRoot) {
|
|
33
36
|
throw new Error("hydrateRoot not found");
|
|
34
37
|
}
|
|
35
38
|
React.startTransition(() => {
|
|
36
39
|
hydrateRoot(container, app);
|
|
40
|
+
CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = false;
|
|
37
41
|
});
|
|
38
42
|
}
|
|
39
43
|
}
|
|
@@ -36,7 +36,7 @@ const PQueue__default = /*#__PURE__*/_interopDefaultCompat(PQueue);
|
|
|
36
36
|
const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
37
37
|
const ReactDomServer__namespace = /*#__PURE__*/_interopNamespaceCompat(ReactDomServer);
|
|
38
38
|
|
|
39
|
-
const version = "0.8.
|
|
39
|
+
const version = "0.8.4";
|
|
40
40
|
|
|
41
41
|
function buildLog(text, count) {
|
|
42
42
|
console.log(`
|
|
@@ -173,7 +173,7 @@ async function renderHTML({
|
|
|
173
173
|
const attributesStringified = [...node.attributes.map(({ name: { value: name }, value }) => `${name}="${value.value}"`)].join(" ");
|
|
174
174
|
const indexHTMLBefore = indexHTML.slice(0, node.start);
|
|
175
175
|
const indexHTMLAfter = indexHTML.slice(node.end);
|
|
176
|
-
renderedOutput = `${indexHTMLBefore}<${node.name} ${attributesStringified} data-server-rendered="true">${appHTML}</${node.name}>${stateScript}${indexHTMLAfter}`;
|
|
176
|
+
renderedOutput = `${indexHTMLBefore}<${node.name} ${attributesStringified} data-server-rendered="true">${appHTML}</${node.name}>${stateScript}${scriptPlaceHolder}${indexHTMLAfter}`;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
});
|
|
@@ -773,9 +773,11 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
773
773
|
customLogger: clientLogger,
|
|
774
774
|
mode: config.mode
|
|
775
775
|
}));
|
|
776
|
+
let unmock = () => {
|
|
777
|
+
};
|
|
776
778
|
if (mock) {
|
|
777
779
|
const { jsdomGlobal } = await import('../chunks/jsdomGlobal.cjs');
|
|
778
|
-
jsdomGlobal();
|
|
780
|
+
unmock = jsdomGlobal();
|
|
779
781
|
}
|
|
780
782
|
buildLog("Build for server...");
|
|
781
783
|
process.env.VITE_SSG = "true";
|
|
@@ -809,7 +811,7 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
809
811
|
const ext = format === "esm" ? ".mjs" : ".cjs";
|
|
810
812
|
const serverEntry = node_path.join(prefix, ssgOut, node_path.parse(ssrEntry).name + ext);
|
|
811
813
|
const serverManifest = JSON.parse(await fs__default.readFile(node_path.join(ssgOut, ...dotVitedir, "manifest.json"), "utf-8"));
|
|
812
|
-
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/vite-react-ssg.
|
|
814
|
+
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/vite-react-ssg.Dus0yLsZ.cjs', document.baseURI).href)));
|
|
813
815
|
const { createRoot, includedRoutes: serverEntryIncludedRoutes } = format === "esm" ? await import(serverEntry) : _require(serverEntry);
|
|
814
816
|
const includedRoutes = serverEntryIncludedRoutes || configIncludedRoutes;
|
|
815
817
|
const { routes } = await createRoot(false);
|
|
@@ -882,6 +884,7 @@ ${err.stack}`);
|
|
|
882
884
|
`${kolorist.dim(`${outDir}/`)}${kolorist.cyan(`static-loader-data-manifest-${hash}.json`.padEnd(15, " "))} ${kolorist.dim(getSize(staticLoaderDataManifestString))}`
|
|
883
885
|
);
|
|
884
886
|
await fs__default.remove(node_path.join(root, ".vite-react-ssg-temp"));
|
|
887
|
+
unmock();
|
|
885
888
|
const pwaPlugin = config.plugins.find((i) => i.name === "vite-plugin-pwa")?.api;
|
|
886
889
|
if (pwaPlugin && !pwaPlugin.disabled && pwaPlugin.generateSW) {
|
|
887
890
|
buildLog("Regenerate PWA...");
|
package/dist/tanstack.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
const reactHelmetAsync = require('react-helmet-async');
|
|
5
5
|
const reactRouter = require('@tanstack/react-router');
|
|
6
6
|
const start = require('@tanstack/start');
|
|
7
|
-
const ClientOnly = require('./shared/vite-react-ssg.
|
|
7
|
+
const ClientOnly = require('./shared/vite-react-ssg.B4jDfvXh.cjs');
|
|
8
8
|
const state = require('./shared/vite-react-ssg.CjsEygxB.cjs');
|
|
9
9
|
const tanstackRouter = require('./shared/vite-react-ssg.DWHmkjdM.cjs');
|
|
10
10
|
const path = require('./shared/vite-react-ssg.CFQGqC60.cjs');
|
package/dist/tanstack.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { HelmetProvider } from 'react-helmet-async';
|
|
3
3
|
import { RouterProvider } from '@tanstack/react-router';
|
|
4
4
|
import { Meta, StartClient } from '@tanstack/start';
|
|
5
|
-
import { r as render, h as hydrate, d as documentReady } from './shared/vite-react-ssg.
|
|
6
|
-
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.
|
|
5
|
+
import { r as render, h as hydrate, d as documentReady } from './shared/vite-react-ssg.CfJcpdWF.mjs';
|
|
6
|
+
export { C as ClientOnly, H as Head } from './shared/vite-react-ssg.CfJcpdWF.mjs';
|
|
7
7
|
import { d as deserializeState } from './shared/vite-react-ssg.C6pK7rvr.mjs';
|
|
8
8
|
import { M as META_CONTAINER_ID, c as convertRouteTreeToRouteOption } from './shared/vite-react-ssg.B-j07kW6.mjs';
|
|
9
9
|
export { r as registerPaths } from './shared/vite-react-ssg.B-j07kW6.mjs';
|
package/package.json
CHANGED