rari 0.2.6 → 0.2.8
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/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{runtime-client-P4vvSVPV.d.ts → runtime-client-BEWMJWMx.d.ts} +0 -1
- package/dist/{runtime-client-CcEhh-F7.js → runtime-client-CC4YQweh.js} +18 -48
- package/dist/{server-MkYb94pQ.js → server-DeSCwqZZ.js} +31 -255
- package/dist/{server-Ph4oyo0B.d.ts → server-MY0-nRif.d.ts} +2 -47
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/package.json +7 -8
- package/src/router/index.ts +6 -12
- package/src/router/router.tsx +45 -101
- package/src/router/types.ts +1 -2
- package/src/server.ts +1 -1
- package/src/vite/index.ts +25 -242
- package/dist/client-dev.d.ts +0 -2
- package/dist/client-dev.js +0 -3
package/dist/client.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ErrorBoundaryProps, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, Route, RouteComponent, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-
|
|
1
|
+
import { ErrorBoundaryProps, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, Route, RouteComponent, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-BEWMJWMx.js";
|
|
2
2
|
export { type ErrorBoundaryProps, type FileRouteInfo, HttpRuntimeClient, type LayoutProps, Link, type LinkProps, type LoadingProps, Navigate, type NavigationOptions, type NavigationState, Outlet, type PageComponent, type PageProps, RouteComponent as Route, type RouteGenerationOptions, type RouteMatch, type RouteMeta, type RouteParams, type Route as RouteType, type RouterConfig, type RouterContext, RouterProvider, type RouterProviderProps, Routes, type RuntimeClient, type SearchParams, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter };
|
package/dist/client.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, router_default, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-
|
|
1
|
+
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, router_default, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-CC4YQweh.js";
|
|
2
2
|
|
|
3
3
|
export { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, router_default as RouterProvider, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ErrorBoundaryProps, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, Route, RouteComponent, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern,
|
|
3
|
-
export { ErrorBoundaryProps, FileRouteGenerator, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, RouteComponent as Route, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, Route as RouteType, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient,
|
|
1
|
+
import { ErrorBoundaryProps, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, Route, RouteComponent, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-BEWMJWMx.js";
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-MY0-nRif.js";
|
|
3
|
+
export { ErrorBoundaryProps, FileRouteGenerator, FileRouteInfo, HttpRuntimeClient, LayoutProps, Link, LinkProps, LoadingProps, Navigate, NavigationOptions, NavigationState, Outlet, PageComponent, PageProps, RouteComponent as Route, RouteGenerationOptions, RouteMatch, RouteMeta, RouteParams, Route as RouteType, RouterConfig, RouterContext, RouterProvider, RouterProviderProps, Routes, RuntimeClient, SearchParams, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createRouteManifest, defineRariConfig, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, router_default, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern,
|
|
1
|
+
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, router_default, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-CC4YQweh.js";
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-DeSCwqZZ.js";
|
|
3
3
|
import "./server-build-DaBgiV55.js";
|
|
4
4
|
|
|
5
|
-
export { FileRouteGenerator, HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, router_default as RouterProvider, Routes, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient,
|
|
5
|
+
export { FileRouteGenerator, HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, router_default as RouterProvider, Routes, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createRouteManifest, defineRariConfig, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
|
@@ -72,7 +72,6 @@ interface RouterContext {
|
|
|
72
72
|
replace: (path: string, options?: Omit<NavigationOptions, 'replace'>) => void;
|
|
73
73
|
isActive: (path: string, exact?: boolean) => boolean;
|
|
74
74
|
config: RouterConfig;
|
|
75
|
-
isReady: boolean;
|
|
76
75
|
}
|
|
77
76
|
interface NavigationState {
|
|
78
77
|
isNavigating: boolean;
|
|
@@ -228,7 +228,8 @@ function RouterProvider({ config = DEFAULT_CONFIG, routes = DEFAULT_ROUTES, chil
|
|
|
228
228
|
caseSensitive: false,
|
|
229
229
|
...config
|
|
230
230
|
}), [config]);
|
|
231
|
-
const
|
|
231
|
+
const [currentRoute, setCurrentRoute] = useState(null);
|
|
232
|
+
const updateCurrentRoute = useCallback((url) => {
|
|
232
233
|
const { pathname, search, hash, searchParams } = parseUrl(url);
|
|
233
234
|
const normalizedPathname = normalizePathname(pathname);
|
|
234
235
|
const match = findMatchingRoute(normalizedPathname, routes);
|
|
@@ -240,43 +241,15 @@ function RouterProvider({ config = DEFAULT_CONFIG, routes = DEFAULT_ROUTES, chil
|
|
|
240
241
|
hash
|
|
241
242
|
};
|
|
242
243
|
enhancedMatch.childMatch = findDeepestChildMatch(enhancedMatch, normalizedPathname);
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
return null;
|
|
244
|
+
setCurrentRoute(enhancedMatch);
|
|
245
|
+
} else setCurrentRoute(null);
|
|
246
246
|
}, [routes]);
|
|
247
|
-
const [routerState, setRouterState] = useState(() => {
|
|
248
|
-
if (typeof window === "undefined") return {
|
|
249
|
-
currentRoute: null,
|
|
250
|
-
isReady: false
|
|
251
|
-
};
|
|
252
|
-
const url = mergedConfig.useHash ? window.location.hash.slice(1) || "/" : window.location.pathname + window.location.search + window.location.hash;
|
|
253
|
-
let initialRoute;
|
|
254
|
-
try {
|
|
255
|
-
initialRoute = resolveRoute(url);
|
|
256
|
-
} catch (error) {
|
|
257
|
-
console.error("Error resolving initial route:", error);
|
|
258
|
-
initialRoute = null;
|
|
259
|
-
}
|
|
260
|
-
const isReady$1 = true;
|
|
261
|
-
return {
|
|
262
|
-
currentRoute: initialRoute,
|
|
263
|
-
isReady: isReady$1
|
|
264
|
-
};
|
|
265
|
-
});
|
|
266
|
-
const currentRoute = routerState.currentRoute;
|
|
267
|
-
const isReady = routerState.isReady;
|
|
268
|
-
const updateCurrentRoute = useCallback((url) => {
|
|
269
|
-
const route = resolveRoute(url);
|
|
270
|
-
setRouterState({
|
|
271
|
-
currentRoute: route,
|
|
272
|
-
isReady: true
|
|
273
|
-
});
|
|
274
|
-
}, [resolveRoute]);
|
|
275
247
|
useEffect(() => {
|
|
276
248
|
const handleLocationChange = () => {
|
|
277
249
|
const url = mergedConfig.useHash ? window.location.hash.slice(1) || "/" : window.location.pathname + window.location.search + window.location.hash;
|
|
278
250
|
updateCurrentRoute(url);
|
|
279
251
|
};
|
|
252
|
+
handleLocationChange();
|
|
280
253
|
const handlePopState = () => {
|
|
281
254
|
handleLocationChange();
|
|
282
255
|
};
|
|
@@ -326,19 +299,16 @@ function RouterProvider({ config = DEFAULT_CONFIG, routes = DEFAULT_ROUTES, chil
|
|
|
326
299
|
if (!currentRoute) return false;
|
|
327
300
|
return isPathActive(currentRoute.pathname, path, exact);
|
|
328
301
|
}, [currentRoute]);
|
|
329
|
-
const contextValue = useMemo(() => {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
isReady
|
|
340
|
-
};
|
|
341
|
-
}, [
|
|
302
|
+
const contextValue = useMemo(() => ({
|
|
303
|
+
currentRoute,
|
|
304
|
+
routes,
|
|
305
|
+
navigate,
|
|
306
|
+
back,
|
|
307
|
+
forward,
|
|
308
|
+
replace,
|
|
309
|
+
isActive,
|
|
310
|
+
config: mergedConfig
|
|
311
|
+
}), [
|
|
342
312
|
currentRoute,
|
|
343
313
|
routes,
|
|
344
314
|
navigate,
|
|
@@ -346,8 +316,7 @@ function RouterProvider({ config = DEFAULT_CONFIG, routes = DEFAULT_ROUTES, chil
|
|
|
346
316
|
forward,
|
|
347
317
|
replace,
|
|
348
318
|
isActive,
|
|
349
|
-
mergedConfig
|
|
350
|
-
isReady
|
|
319
|
+
mergedConfig
|
|
351
320
|
]);
|
|
352
321
|
return /* @__PURE__ */ jsx(RouterContext, {
|
|
353
322
|
value: contextValue,
|
|
@@ -387,7 +356,8 @@ function useParams() {
|
|
|
387
356
|
return currentRoute?.params || {};
|
|
388
357
|
}
|
|
389
358
|
function useSearchParams() {
|
|
390
|
-
const { currentRoute
|
|
359
|
+
const { currentRoute } = useRouter();
|
|
360
|
+
const { navigate } = useRouter();
|
|
391
361
|
const searchParams = currentRoute?.searchParams || {};
|
|
392
362
|
const setSearchParams = useCallback((params, options = DEFAULT_CONFIG) => {
|
|
393
363
|
const newParams = typeof params === "function" ? params(searchParams) : params;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { __commonJS, __require, __toESM } from "./chunk-BLXvPPr8.js";
|
|
2
|
-
import { analyzeFilePath } from "./runtime-client-
|
|
2
|
+
import { analyzeFilePath } from "./runtime-client-CC4YQweh.js";
|
|
3
3
|
import { createServerBuildPlugin } from "./server-build-DaBgiV55.js";
|
|
4
4
|
import fs, { promises } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process$1 from "node:process";
|
|
7
7
|
import { spawn } from "node:child_process";
|
|
8
8
|
import * as acorn from "acorn";
|
|
9
|
-
import { minify } from "rollup-plugin-esbuild";
|
|
10
9
|
|
|
11
10
|
//#region ../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js
|
|
12
11
|
var require_constants$2 = __commonJS({ "../../node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/constants.js"(exports, module) {
|
|
@@ -5743,6 +5742,7 @@ function rari(options = {}) {
|
|
|
5743
5742
|
}
|
|
5744
5743
|
newCode += `
|
|
5745
5744
|
|
|
5745
|
+
// HMR acceptance for server components
|
|
5746
5746
|
if (import.meta.hot) {
|
|
5747
5747
|
import.meta.hot.accept(() => {
|
|
5748
5748
|
// Server component updated, no need to reload
|
|
@@ -5832,14 +5832,6 @@ if (import.meta.hot) {
|
|
|
5832
5832
|
const existingDedupe = Array.isArray(config.resolve.dedupe) ? config.resolve.dedupe : [];
|
|
5833
5833
|
const toAdd = ["react", "react-dom"];
|
|
5834
5834
|
config.resolve.dedupe = Array.from(new Set([...existingDedupe || [], ...toAdd]));
|
|
5835
|
-
const existingResolveAlias = config.resolve.alias || {};
|
|
5836
|
-
config.resolve.alias = {
|
|
5837
|
-
...existingResolveAlias,
|
|
5838
|
-
"react-dom/server": "react-dom/server.browser",
|
|
5839
|
-
"react-dom$": "react-dom/client",
|
|
5840
|
-
"react-dom/cjs/react-dom.production.min.js": "react-dom/client",
|
|
5841
|
-
"react-dom/cjs/react-dom.development.js": "react-dom/client"
|
|
5842
|
-
};
|
|
5843
5835
|
const existingAlias = Array.isArray(config.resolve.alias) ? config.resolve.alias : [];
|
|
5844
5836
|
const aliasFinds = new Set(existingAlias.map((a) => String(a.find)));
|
|
5845
5837
|
try {
|
|
@@ -5888,17 +5880,13 @@ if (import.meta.hot) {
|
|
|
5888
5880
|
config.optimizeDeps = config.optimizeDeps || {};
|
|
5889
5881
|
config.optimizeDeps.include = config.optimizeDeps.include || [];
|
|
5890
5882
|
if (!config.optimizeDeps.include.includes("react-dom/server")) config.optimizeDeps.include.push("react-dom/server");
|
|
5891
|
-
if (!config.optimizeDeps.include.includes("react")) config.optimizeDeps.include.push("react");
|
|
5892
|
-
if (!config.optimizeDeps.include.includes("react-dom/client")) config.optimizeDeps.include.push("react-dom/client");
|
|
5893
|
-
config.optimizeDeps.exclude = config.optimizeDeps.exclude || [];
|
|
5894
|
-
if (!config.optimizeDeps.exclude.includes("virtual:rsc-integration")) config.optimizeDeps.exclude.push("virtual:rsc-integration");
|
|
5895
5883
|
if (command === "build") for (const envName of [
|
|
5896
5884
|
"rsc",
|
|
5897
5885
|
"ssr",
|
|
5898
5886
|
"client"
|
|
5899
5887
|
]) {
|
|
5900
5888
|
const env = config.environments[envName];
|
|
5901
|
-
if (env && env.build) env.build.
|
|
5889
|
+
if (env && env.build) env.build.rollupOptions = env.build.rollupOptions || {};
|
|
5902
5890
|
}
|
|
5903
5891
|
config.server = config.server || {};
|
|
5904
5892
|
config.server.proxy = config.server.proxy || {};
|
|
@@ -5924,183 +5912,19 @@ if (import.meta.hot) {
|
|
|
5924
5912
|
};
|
|
5925
5913
|
if (command === "build") {
|
|
5926
5914
|
config.build = config.build || {};
|
|
5927
|
-
config.build.
|
|
5928
|
-
config.build.
|
|
5929
|
-
if (Array.isArray(config.build.rolldownOptions.plugins)) {
|
|
5930
|
-
config.build.rolldownOptions.plugins.push(minify());
|
|
5931
|
-
config.build.rolldownOptions.plugins.push({
|
|
5932
|
-
name: "html-css-optimizer",
|
|
5933
|
-
generateBundle(options$1, bundle) {
|
|
5934
|
-
Object.keys(bundle).forEach((fileName) => {
|
|
5935
|
-
const file = bundle[fileName];
|
|
5936
|
-
if (file.type === "asset" && fileName.endsWith(".html")) {
|
|
5937
|
-
let html = file.source;
|
|
5938
|
-
html = html.replace(/<link\s+rel="stylesheet"\s+crossorigin\s+href="([^"]+\.css)"\s*>/g, (match, href) => {
|
|
5939
|
-
return `<link rel="preload" as="style" crossorigin href="${href}" fetchpriority="high" onload="this.onload=null;this.rel='stylesheet'">
|
|
5940
|
-
<noscript><link rel="stylesheet" crossorigin href="${href}"></noscript>`;
|
|
5941
|
-
});
|
|
5942
|
-
const scriptMatch = html.match(/<script\s+type="module"\s+crossorigin\s+src="([^"]+)"\s*><\/script>/);
|
|
5943
|
-
if (scriptMatch) {
|
|
5944
|
-
const mainJsHref = scriptMatch[1];
|
|
5945
|
-
html = html.replace(scriptMatch[0], `<link rel="preload" as="script" crossorigin href="${mainJsHref}" fetchpriority="high">
|
|
5946
|
-
<script type="module" crossorigin src="${mainJsHref}" fetchpriority="high"><\/script>`);
|
|
5947
|
-
}
|
|
5948
|
-
file.source = html;
|
|
5949
|
-
}
|
|
5950
|
-
});
|
|
5951
|
-
}
|
|
5952
|
-
});
|
|
5953
|
-
}
|
|
5954
|
-
if (!config.build.rolldownOptions.input) config.build.rolldownOptions.input = { main: "./index.html" };
|
|
5955
|
-
config.build.rolldownOptions.output = config.build.rolldownOptions.output || {};
|
|
5956
|
-
const outputConfig = Array.isArray(config.build.rolldownOptions.output) ? config.build.rolldownOptions.output[0] || {} : config.build.rolldownOptions.output;
|
|
5957
|
-
outputConfig.manualChunks = (id) => {
|
|
5958
|
-
if (id.includes("node_modules/react-dom") || id.includes("react-dom/client") || id.includes("react-dom/server") || id.includes("react-dom/")) return "react-dom";
|
|
5959
|
-
if ((id.includes("node_modules/react") || id.includes("react/")) && !id.includes("react-dom")) return "react";
|
|
5960
|
-
if (id.includes("scheduler") && id.includes("node_modules")) return "scheduler";
|
|
5961
|
-
if (id.includes("markdown-it") || id.includes("shiki")) return "vendor";
|
|
5962
|
-
if (id.includes("node_modules")) return "vendor";
|
|
5963
|
-
};
|
|
5964
|
-
config.build.rolldownOptions.treeshake = config.build.rolldownOptions.treeshake || {
|
|
5965
|
-
moduleSideEffects: (id) => {
|
|
5966
|
-
if (id.includes(".css") || id.includes("polyfill")) return true;
|
|
5967
|
-
if (id.includes("react-dom") || id.includes("react") || id.includes("scheduler") || id.includes("react-dom/client") || id.includes("react-dom/server")) return true;
|
|
5968
|
-
if (id.includes("node_modules") && !id.includes("react")) return false;
|
|
5969
|
-
return true;
|
|
5970
|
-
},
|
|
5971
|
-
unknownGlobalSideEffects: false
|
|
5972
|
-
};
|
|
5973
|
-
const existingExternal = config.build.rolldownOptions?.external || [];
|
|
5974
|
-
const reactDomExternals = [
|
|
5975
|
-
"react-dom/profiling",
|
|
5976
|
-
"react-dom/test-utils",
|
|
5977
|
-
"react-dom/server",
|
|
5978
|
-
"react-dom/server.browser",
|
|
5979
|
-
"react-dom/server.node",
|
|
5980
|
-
"react/jsx-dev-runtime",
|
|
5981
|
-
"scheduler/tracing",
|
|
5982
|
-
"scheduler/unstable_mock",
|
|
5983
|
-
"react/cjs/react.development.js",
|
|
5984
|
-
"react/cjs/react.production.min.js",
|
|
5985
|
-
"react-dom/cjs/react-dom.development.js",
|
|
5986
|
-
"react-dom/cjs/react-dom.production.min.js",
|
|
5987
|
-
"react-dom/src/client/ReactDOMRoot.js",
|
|
5988
|
-
"react-dom/src/events/plugins",
|
|
5989
|
-
"react-dom/src/shared/HTMLDOMPropertyConfig.js",
|
|
5990
|
-
"react-dom/src/shared/DOMPropertyOperations.js"
|
|
5991
|
-
];
|
|
5992
|
-
if (Array.isArray(existingExternal)) {
|
|
5993
|
-
const external = [...existingExternal];
|
|
5994
|
-
external.push(...reactDomExternals.filter((dep) => !external.includes(dep)));
|
|
5995
|
-
config.build.rolldownOptions.external = external;
|
|
5996
|
-
} else if (typeof existingExternal === "function") {
|
|
5997
|
-
const originalExternal = existingExternal;
|
|
5998
|
-
config.build.rolldownOptions.external = (id, parentId, isResolved) => {
|
|
5999
|
-
if (reactDomExternals.includes(id)) return true;
|
|
6000
|
-
return originalExternal(id, parentId, isResolved);
|
|
6001
|
-
};
|
|
6002
|
-
} else config.build.rolldownOptions.external = [...Array.isArray(existingExternal) ? existingExternal : [existingExternal], ...reactDomExternals].filter(Boolean);
|
|
6003
|
-
config.build.minify = true;
|
|
6004
|
-
config.build.target = config.build.target || [
|
|
6005
|
-
"es2020",
|
|
6006
|
-
"edge88",
|
|
6007
|
-
"firefox78",
|
|
6008
|
-
"chrome87",
|
|
6009
|
-
"safari14"
|
|
6010
|
-
];
|
|
6011
|
-
config.build.cssMinify = config.build.cssMinify !== false ? "esbuild" : false;
|
|
6012
|
-
config.build.cssCodeSplit = true;
|
|
6013
|
-
config.build.assetsInlineLimit = 4096;
|
|
6014
|
-
config.build.chunkSizeWarningLimit = 1e3;
|
|
6015
|
-
config.build.sourcemap = config.build.sourcemap !== void 0 ? config.build.sourcemap : true;
|
|
6016
|
-
config.build.terserOptions = config.build.terserOptions || {
|
|
6017
|
-
compress: {
|
|
6018
|
-
drop_console: true,
|
|
6019
|
-
drop_debugger: true,
|
|
6020
|
-
pure_funcs: [
|
|
6021
|
-
"console.log",
|
|
6022
|
-
"console.info",
|
|
6023
|
-
"console.debug",
|
|
6024
|
-
"console.warn",
|
|
6025
|
-
"invariant",
|
|
6026
|
-
"warning",
|
|
6027
|
-
"__DEV__",
|
|
6028
|
-
"ReactDOM.render",
|
|
6029
|
-
"ReactDOM.unmountComponentAtNode",
|
|
6030
|
-
"ReactDOM.findDOMNode",
|
|
6031
|
-
"ReactDOM.createPortal"
|
|
6032
|
-
],
|
|
6033
|
-
passes: 3,
|
|
6034
|
-
unsafe: true,
|
|
6035
|
-
unsafe_comps: true,
|
|
6036
|
-
unsafe_Function: true,
|
|
6037
|
-
unsafe_math: true,
|
|
6038
|
-
unsafe_symbols: true,
|
|
6039
|
-
unsafe_methods: true,
|
|
6040
|
-
unsafe_proto: true,
|
|
6041
|
-
unsafe_regexp: true,
|
|
6042
|
-
unsafe_undefined: true,
|
|
6043
|
-
dead_code: true,
|
|
6044
|
-
side_effects: false
|
|
6045
|
-
},
|
|
6046
|
-
mangle: {
|
|
6047
|
-
safari10: true,
|
|
6048
|
-
properties: { regex: /^_/ }
|
|
6049
|
-
},
|
|
6050
|
-
format: { comments: false }
|
|
6051
|
-
};
|
|
6052
|
-
outputConfig.format = outputConfig.format || "es";
|
|
6053
|
-
outputConfig.minify = true;
|
|
6054
|
-
if (Array.isArray(config.build.rolldownOptions.output)) config.build.rolldownOptions.output[0] = outputConfig;
|
|
6055
|
-
else config.build.rolldownOptions.output = outputConfig;
|
|
5915
|
+
config.build.rollupOptions = config.build.rollupOptions || {};
|
|
5916
|
+
if (!config.build.rollupOptions.input) config.build.rollupOptions.input = { main: "./index.html" };
|
|
6056
5917
|
}
|
|
6057
5918
|
if (config.environments && config.environments.client) {
|
|
6058
5919
|
if (!config.environments.client.build) config.environments.client.build = {};
|
|
6059
|
-
if (!config.environments.client.build.
|
|
6060
|
-
if (!config.environments.client.build.
|
|
6061
|
-
if (typeof config.environments.client.build.
|
|
6062
|
-
config.environments.client.build.rolldownOptions.plugins = config.environments.client.build.rolldownOptions.plugins || [];
|
|
6063
|
-
if (Array.isArray(config.environments.client.build.rolldownOptions.plugins)) config.environments.client.build.rolldownOptions.plugins.push(minify());
|
|
6064
|
-
config.environments.client.build.minify = true;
|
|
6065
|
-
config.environments.client.build.target = config.environments.client.build.target || [
|
|
6066
|
-
"es2020",
|
|
6067
|
-
"edge88",
|
|
6068
|
-
"firefox78",
|
|
6069
|
-
"chrome87",
|
|
6070
|
-
"safari14"
|
|
6071
|
-
];
|
|
6072
|
-
config.environments.client.build.cssMinify = "esbuild";
|
|
6073
|
-
config.environments.client.build.cssCodeSplit = true;
|
|
6074
|
-
config.environments.client.build.assetsInlineLimit = 4096;
|
|
6075
|
-
config.environments.client.build.rolldownOptions.treeshake = {
|
|
6076
|
-
moduleSideEffects: false,
|
|
6077
|
-
unknownGlobalSideEffects: false
|
|
6078
|
-
};
|
|
6079
|
-
config.environments.client.build.rolldownOptions.output = config.environments.client.build.rolldownOptions.output || {};
|
|
6080
|
-
const clientOutputConfig = Array.isArray(config.environments.client.build.rolldownOptions.output) ? config.environments.client.build.rolldownOptions.output[0] || {} : config.environments.client.build.rolldownOptions.output;
|
|
6081
|
-
clientOutputConfig.manualChunks = (id) => {
|
|
6082
|
-
if (id.includes("node_modules/react-dom") || id.includes("react-dom/client") || id.includes("react-dom/server") || id.includes("react-dom/")) return "react-dom";
|
|
6083
|
-
if ((id.includes("node_modules/react") || id.includes("react/")) && !id.includes("react-dom")) return "react";
|
|
6084
|
-
if (id.includes("scheduler") && id.includes("node_modules")) return "scheduler";
|
|
6085
|
-
if (id.includes("rari") && (id.includes("router") || id.includes("navigation"))) return "router";
|
|
6086
|
-
if (id.includes("markdown-it") || id.includes("shiki")) return "vendor";
|
|
6087
|
-
if (id.includes("node_modules")) return "vendor";
|
|
6088
|
-
};
|
|
6089
|
-
clientOutputConfig.format = clientOutputConfig.format || "es";
|
|
6090
|
-
clientOutputConfig.minify = true;
|
|
6091
|
-
if (Array.isArray(config.environments.client.build.rolldownOptions.output)) config.environments.client.build.rolldownOptions.output[0] = clientOutputConfig;
|
|
6092
|
-
else config.environments.client.build.rolldownOptions.output = clientOutputConfig;
|
|
5920
|
+
if (!config.environments.client.build.rollupOptions) config.environments.client.build.rollupOptions = {};
|
|
5921
|
+
if (!config.environments.client.build.rollupOptions.input) config.environments.client.build.rollupOptions.input = {};
|
|
5922
|
+
if (typeof config.environments.client.build.rollupOptions.input === "object" && !Array.isArray(config.environments.client.build.rollupOptions.input)) config.environments.client.build.rollupOptions.input["client-components"] = "virtual:rsc-client-components";
|
|
6093
5923
|
}
|
|
6094
5924
|
return config;
|
|
6095
5925
|
},
|
|
6096
5926
|
transform(code, id) {
|
|
6097
5927
|
if (!/\.(?:tsx?|jsx?)$/.test(id)) return null;
|
|
6098
|
-
if (code.includes("react-dom")) {
|
|
6099
|
-
code = code.replace(/import\s+ReactDOM\s+from\s+['"]react-dom\/client['"];?/g, "import { createRoot, hydrateRoot } from 'react-dom/client';");
|
|
6100
|
-
code = code.replace(/import\s+ReactDOM\s+from\s+['"]react-dom['"];?/g, "import { createRoot, hydrateRoot } from 'react-dom/client';");
|
|
6101
|
-
code = code.replace(/ReactDOM\.createRoot/g, "createRoot");
|
|
6102
|
-
code = code.replace(/ReactDOM\.hydrateRoot/g, "hydrateRoot");
|
|
6103
|
-
}
|
|
6104
5928
|
const environment = this.environment;
|
|
6105
5929
|
if (hasTopLevelDirective(code, "use client")) {
|
|
6106
5930
|
componentTypeCache.set(id, "client");
|
|
@@ -6550,6 +6374,7 @@ export const __CLIENT_REFERENCE_REGISTRY__ = clientReferenceRegistry;
|
|
|
6550
6374
|
export const __SERVER_REFERENCE_REGISTRY__ = serverReferenceRegistry;
|
|
6551
6375
|
export const __CLIENT_COMPONENT_REGISTRY__ = clientComponentRegistry;
|
|
6552
6376
|
|
|
6377
|
+
// Module map for React Server Components
|
|
6553
6378
|
export function createClientModuleMap() {
|
|
6554
6379
|
const moduleMap = {};
|
|
6555
6380
|
|
|
@@ -6572,6 +6397,7 @@ export function createClientModuleMap() {
|
|
|
6572
6397
|
if (id === "virtual:rsc-integration") return `
|
|
6573
6398
|
import React, { useState, useEffect, Suspense } from 'react';
|
|
6574
6399
|
|
|
6400
|
+
// Client component registration for RSC system compatibility
|
|
6575
6401
|
if (typeof globalThis.__clientComponents === 'undefined') {
|
|
6576
6402
|
globalThis.__clientComponents = {};
|
|
6577
6403
|
}
|
|
@@ -6589,6 +6415,7 @@ export function registerClientComponent(componentFunction, id, exportName) {
|
|
|
6589
6415
|
|
|
6590
6416
|
const componentId = componentName;
|
|
6591
6417
|
|
|
6418
|
+
// Register in global registry for RSC traversal
|
|
6592
6419
|
globalThis.__clientComponents[componentId] = {
|
|
6593
6420
|
id: componentId,
|
|
6594
6421
|
path: id,
|
|
@@ -7349,7 +7176,7 @@ class RscClient {
|
|
|
7349
7176
|
const processedChildren = value.map((child, index) => {
|
|
7350
7177
|
const result = this.reconstructElementFromRscData(child, modules);
|
|
7351
7178
|
return result;
|
|
7352
|
-
}).filter(child => child !== null && child !== undefined);
|
|
7179
|
+
}).filter(child => child !== null && child !== undefined); // Remove null/undefined children
|
|
7353
7180
|
|
|
7354
7181
|
if (processedChildren.length === 0) {
|
|
7355
7182
|
processed[key] = null;
|
|
@@ -7494,6 +7321,7 @@ function ServerComponentWrapper({
|
|
|
7494
7321
|
}
|
|
7495
7322
|
|
|
7496
7323
|
function createServerComponentWrapper(componentName, importPath) {
|
|
7324
|
+
// Use a global refresh counter to force re-mounting when components change
|
|
7497
7325
|
let globalRefreshCounter = 0;
|
|
7498
7326
|
|
|
7499
7327
|
if (typeof window !== 'undefined') {
|
|
@@ -7507,6 +7335,7 @@ function createServerComponentWrapper(componentName, importPath) {
|
|
|
7507
7335
|
const ServerComponent = (props) => {
|
|
7508
7336
|
const [mountKey, setMountKey] = useState(globalRefreshCounter);
|
|
7509
7337
|
|
|
7338
|
+
// Force re-mount when component is invalidated
|
|
7510
7339
|
useEffect(() => {
|
|
7511
7340
|
const handleRscInvalidate = (event) => {
|
|
7512
7341
|
const detail = event.detail;
|
|
@@ -7527,7 +7356,7 @@ function createServerComponentWrapper(componentName, importPath) {
|
|
|
7527
7356
|
return React.createElement(Suspense, {
|
|
7528
7357
|
fallback: null
|
|
7529
7358
|
}, React.createElement(ServerComponentWrapper, {
|
|
7530
|
-
key: componentName + '-' + mountKey,
|
|
7359
|
+
key: componentName + '-' + mountKey, // Force re-mount with key change
|
|
7531
7360
|
componentId: componentName,
|
|
7532
7361
|
props: props,
|
|
7533
7362
|
fallback: null
|
|
@@ -7544,7 +7373,9 @@ function createServerComponentWrapper(componentName, importPath) {
|
|
|
7544
7373
|
export const fetchServerComponent = (componentId, props) =>
|
|
7545
7374
|
rscClient.fetchServerComponent(componentId, props);
|
|
7546
7375
|
|
|
7376
|
+
// Helper function to check if a file is a server component (client-side)
|
|
7547
7377
|
function isServerComponent(filePath) {
|
|
7378
|
+
// Simple client-side check based on file path patterns
|
|
7548
7379
|
return filePath && (
|
|
7549
7380
|
filePath.includes('ServerWithClient') ||
|
|
7550
7381
|
filePath.includes('server') ||
|
|
@@ -7552,26 +7383,32 @@ function isServerComponent(filePath) {
|
|
|
7552
7383
|
);
|
|
7553
7384
|
}
|
|
7554
7385
|
|
|
7386
|
+
// HMR support for RSC cache invalidation
|
|
7555
7387
|
if (import.meta.hot) {
|
|
7388
|
+
// Listen for Vite's beforeFullReload event for server components
|
|
7556
7389
|
import.meta.hot.on('vite:beforeFullReload', async (data) => {
|
|
7557
7390
|
if (data?.path && isServerComponent(data.path)) {
|
|
7391
|
+
// Immediately invalidate cache and trigger re-registration before reload
|
|
7558
7392
|
await invalidateRscCache({ filePath: data.path, forceReload: true });
|
|
7559
7393
|
}
|
|
7560
7394
|
});
|
|
7561
7395
|
|
|
7562
7396
|
|
|
7563
7397
|
|
|
7398
|
+
// Helper function to invalidate RSC cache and trigger component re-registration
|
|
7564
7399
|
async function invalidateRscCache(data) {
|
|
7565
7400
|
const filePath = data?.filePath || data;
|
|
7566
7401
|
|
|
7402
|
+
// Wait for server to be ready
|
|
7567
7403
|
const waitForServerReady = async () => {
|
|
7568
|
-
for (let i = 0; i < 20; i++) {
|
|
7404
|
+
for (let i = 0; i < 20; i++) { // Try for up to 2 seconds
|
|
7569
7405
|
try {
|
|
7570
7406
|
const response = await fetch('/_rsc_status');
|
|
7571
7407
|
if (response.ok) {
|
|
7572
7408
|
return true;
|
|
7573
7409
|
}
|
|
7574
7410
|
} catch (e) {
|
|
7411
|
+
// Server not ready yet
|
|
7575
7412
|
}
|
|
7576
7413
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
7577
7414
|
}
|
|
@@ -7580,8 +7417,10 @@ if (import.meta.hot) {
|
|
|
7580
7417
|
|
|
7581
7418
|
const serverReady = await waitForServerReady();
|
|
7582
7419
|
if (serverReady) {
|
|
7420
|
+
// Clear client-side RSC cache immediately
|
|
7583
7421
|
rscClient.clearCache();
|
|
7584
7422
|
|
|
7423
|
+
// Trigger immediate server component re-registration
|
|
7585
7424
|
try {
|
|
7586
7425
|
await fetch('/api/rsc/hmr-register', {
|
|
7587
7426
|
method: 'POST',
|
|
@@ -7593,10 +7432,14 @@ if (import.meta.hot) {
|
|
|
7593
7432
|
})
|
|
7594
7433
|
});
|
|
7595
7434
|
|
|
7435
|
+
// Wait a bit for the server to re-register the component
|
|
7436
|
+
// The server now immediately reads and re-registers the component
|
|
7596
7437
|
await new Promise(resolve => setTimeout(resolve, 300));
|
|
7597
7438
|
} catch (error) {
|
|
7439
|
+
// Fallback to existing timeout-based approach
|
|
7598
7440
|
}
|
|
7599
7441
|
|
|
7442
|
+
// Trigger re-render of active server components
|
|
7600
7443
|
if (typeof window !== 'undefined') {
|
|
7601
7444
|
const event = new CustomEvent('rari:rsc-invalidate', {
|
|
7602
7445
|
detail: { filePath }
|
|
@@ -7666,73 +7509,6 @@ ${registrations.join("\n")}
|
|
|
7666
7509
|
const serverBuildPlugin = createServerBuildPlugin(options.serverBuild);
|
|
7667
7510
|
return [mainPlugin, serverBuildPlugin];
|
|
7668
7511
|
}
|
|
7669
|
-
function createReactDOMOptimization() {
|
|
7670
|
-
return { build: {
|
|
7671
|
-
rollupOptions: {
|
|
7672
|
-
output: { manualChunks: (id) => {
|
|
7673
|
-
if (id.includes("node_modules/react-dom") || id.includes("react-dom/client") || id.includes("react-dom/server") || id.includes("react-dom/")) return "react-dom";
|
|
7674
|
-
if ((id.includes("node_modules/react") || id.includes("react/")) && !id.includes("react-dom")) return "react";
|
|
7675
|
-
if (id.includes("scheduler") && id.includes("node_modules")) return "scheduler";
|
|
7676
|
-
if (id.includes("markdown-it") || id.includes("shiki")) return "vendor";
|
|
7677
|
-
if (id.includes("node_modules")) return "vendor";
|
|
7678
|
-
} },
|
|
7679
|
-
treeshake: {
|
|
7680
|
-
moduleSideEffects: (id) => {
|
|
7681
|
-
if (id.includes(".css") || id.includes("polyfill")) return true;
|
|
7682
|
-
if (id.includes("react-dom") || id.includes("react") || id.includes("scheduler") || id.includes("react-dom/client") || id.includes("react-dom/server")) return false;
|
|
7683
|
-
return false;
|
|
7684
|
-
},
|
|
7685
|
-
unknownGlobalSideEffects: false
|
|
7686
|
-
}
|
|
7687
|
-
},
|
|
7688
|
-
minify: "terser",
|
|
7689
|
-
target: [
|
|
7690
|
-
"es2020",
|
|
7691
|
-
"edge88",
|
|
7692
|
-
"firefox78",
|
|
7693
|
-
"chrome87",
|
|
7694
|
-
"safari14"
|
|
7695
|
-
],
|
|
7696
|
-
cssMinify: "esbuild",
|
|
7697
|
-
sourcemap: false,
|
|
7698
|
-
terserOptions: {
|
|
7699
|
-
compress: {
|
|
7700
|
-
drop_console: true,
|
|
7701
|
-
drop_debugger: true,
|
|
7702
|
-
pure_funcs: [
|
|
7703
|
-
"console.log",
|
|
7704
|
-
"console.info",
|
|
7705
|
-
"console.debug",
|
|
7706
|
-
"console.warn",
|
|
7707
|
-
"invariant",
|
|
7708
|
-
"warning",
|
|
7709
|
-
"__DEV__",
|
|
7710
|
-
"ReactDOM.render",
|
|
7711
|
-
"ReactDOM.unmountComponentAtNode",
|
|
7712
|
-
"ReactDOM.findDOMNode",
|
|
7713
|
-
"ReactDOM.createPortal"
|
|
7714
|
-
],
|
|
7715
|
-
passes: 3,
|
|
7716
|
-
unsafe: true,
|
|
7717
|
-
unsafe_comps: true,
|
|
7718
|
-
unsafe_Function: true,
|
|
7719
|
-
unsafe_math: true,
|
|
7720
|
-
unsafe_symbols: true,
|
|
7721
|
-
unsafe_methods: true,
|
|
7722
|
-
unsafe_proto: true,
|
|
7723
|
-
unsafe_regexp: true,
|
|
7724
|
-
unsafe_undefined: true,
|
|
7725
|
-
dead_code: true,
|
|
7726
|
-
side_effects: false
|
|
7727
|
-
},
|
|
7728
|
-
mangle: {
|
|
7729
|
-
safari10: true,
|
|
7730
|
-
properties: { regex: /^_/ }
|
|
7731
|
-
},
|
|
7732
|
-
format: { comments: false }
|
|
7733
|
-
}
|
|
7734
|
-
} };
|
|
7735
|
-
}
|
|
7736
7512
|
function defineRariConfig(config) {
|
|
7737
7513
|
return {
|
|
7738
7514
|
plugins: [rari(), ...config.plugins || []],
|
|
@@ -7741,4 +7517,4 @@ function defineRariConfig(config) {
|
|
|
7741
7517
|
}
|
|
7742
7518
|
|
|
7743
7519
|
//#endregion
|
|
7744
|
-
export { FileRouteGenerator, convertFilePatternToRoutePattern,
|
|
7520
|
+
export { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Route, RouteGenerationOptions } from "./runtime-client-
|
|
1
|
+
import { Route, RouteGenerationOptions } from "./runtime-client-BEWMJWMx.js";
|
|
2
2
|
import { Plugin, UserConfig } from "rolldown-vite";
|
|
3
3
|
|
|
4
4
|
//#region src/router/file-routes.d.ts
|
|
@@ -62,53 +62,8 @@ interface RariOptions {
|
|
|
62
62
|
serverHandler?: boolean;
|
|
63
63
|
}
|
|
64
64
|
declare function rari(options?: RariOptions): Plugin[];
|
|
65
|
-
declare function createReactDOMOptimization(): {
|
|
66
|
-
build: {
|
|
67
|
-
rollupOptions: {
|
|
68
|
-
output: {
|
|
69
|
-
manualChunks: (id: string) => "react-dom" | "react" | "scheduler" | "vendor" | undefined;
|
|
70
|
-
};
|
|
71
|
-
treeshake: {
|
|
72
|
-
moduleSideEffects: (id: string) => boolean;
|
|
73
|
-
unknownGlobalSideEffects: boolean;
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
minify: string;
|
|
77
|
-
target: string[];
|
|
78
|
-
cssMinify: string;
|
|
79
|
-
sourcemap: boolean;
|
|
80
|
-
terserOptions: {
|
|
81
|
-
compress: {
|
|
82
|
-
drop_console: boolean;
|
|
83
|
-
drop_debugger: boolean;
|
|
84
|
-
pure_funcs: string[];
|
|
85
|
-
passes: number;
|
|
86
|
-
unsafe: boolean;
|
|
87
|
-
unsafe_comps: boolean;
|
|
88
|
-
unsafe_Function: boolean;
|
|
89
|
-
unsafe_math: boolean;
|
|
90
|
-
unsafe_symbols: boolean;
|
|
91
|
-
unsafe_methods: boolean;
|
|
92
|
-
unsafe_proto: boolean;
|
|
93
|
-
unsafe_regexp: boolean;
|
|
94
|
-
unsafe_undefined: boolean;
|
|
95
|
-
dead_code: boolean;
|
|
96
|
-
side_effects: boolean;
|
|
97
|
-
};
|
|
98
|
-
mangle: {
|
|
99
|
-
safari10: boolean;
|
|
100
|
-
properties: {
|
|
101
|
-
regex: RegExp;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
format: {
|
|
105
|
-
comments: boolean;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
65
|
declare function defineRariConfig(config: UserConfig & {
|
|
111
66
|
plugins?: Plugin[];
|
|
112
67
|
}): UserConfig;
|
|
113
68
|
//#endregion
|
|
114
|
-
export { FileRouteGenerator, convertFilePatternToRoutePattern,
|
|
69
|
+
export { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes };
|