@lomray/vite-ssr-boost 1.0.0-beta.27 → 1.0.0-beta.28
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
CHANGED
|
@@ -98,6 +98,10 @@ import App from './App';
|
|
|
98
98
|
import routes from './routes';
|
|
99
99
|
|
|
100
100
|
export default entryServer(App, routes, {
|
|
101
|
+
/**
|
|
102
|
+
* Request timeout (If your backend is slow, increase this value)
|
|
103
|
+
*/
|
|
104
|
+
abortDelay: 15000, // default: 15000 (ms)
|
|
101
105
|
/**
|
|
102
106
|
* Server configuration (optional)
|
|
103
107
|
*/
|
|
@@ -168,23 +172,25 @@ import type { FCRoute } from '@lomray/vite-ssr-boost/interfaces/fc-route';
|
|
|
168
172
|
*/
|
|
169
173
|
SsrBoost({
|
|
170
174
|
/**
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* const Page: FCRoute = () => <div>Hi</div>;
|
|
174
|
-
*
|
|
175
|
-
* Page.ErrorBoudary = () => <div>Error</div>;
|
|
176
|
-
*
|
|
177
|
-
* export default Page;
|
|
178
|
-
*
|
|
179
|
-
* Routes:
|
|
180
|
-
* const routes = [{ path: '/', lazyNR: () => import('./pages/home') }]
|
|
175
|
+
* index.html file path
|
|
181
176
|
*/
|
|
182
|
-
|
|
183
|
-
|
|
177
|
+
indexFile: 'index.html', // default: index.html
|
|
178
|
+
/**
|
|
179
|
+
* Server entrypoint file
|
|
180
|
+
*/
|
|
181
|
+
serverFile: 'server.ts', // default: server.ts
|
|
182
|
+
/**
|
|
183
|
+
* Client entrypoint file
|
|
184
|
+
*/
|
|
185
|
+
clientFile: 'client.ts', // default: client.ts
|
|
184
186
|
/**
|
|
185
187
|
* Add tsconfig aliases to vite config aliases
|
|
186
188
|
*/
|
|
187
189
|
tsconfigAliases: true, // default: true
|
|
190
|
+
/**
|
|
191
|
+
* Production: add scripts to head (server-side)
|
|
192
|
+
*/
|
|
193
|
+
preloadAssets: false, // default: false
|
|
188
194
|
})
|
|
189
195
|
```
|
|
190
196
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-to-top.js","sources":["../../src/components/scroll-to-top.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\n\n/**\n * Scroll page to top on every pathname (url) change\n * @constructor\n */\nconst ScrollToTop: FC = () => {\n const { pathname } = useLocation();\n\n useEffect(() => {\n window.scrollTo(0, 0);\n }, [pathname]);\n\n return null;\n};\n\nexport default ScrollToTop;\n"],"names":["ScrollToTop","pathname","useLocation","useEffect","window","scrollTo"],"mappings":"iFAQM,MAAAA,EAAkB,KACtB,MAAMC,SAAEA,GAAaC,IAMrB,OAJAC,GAAU,KACRC,OAAOC,SAAS,EAAG,EAAE,GACpB,CAACJ,IAEG,IAAI"}
|