@react-router/dev 7.18.0 → 8.0.0-pre.1

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.
@@ -0,0 +1,279 @@
1
+
2
+ import { i as RouteManifestEntry, n as RouteConfigEntry, r as RouteManifest } from "./routes-Kx8VZRs3.js";
3
+ import * as Vite from "vite";
4
+
5
+ //#region config/config.d.ts
6
+ declare const excludedConfigPresetKeys: readonly ["presets"];
7
+ type ExcludedConfigPresetKey = (typeof excludedConfigPresetKeys)[number];
8
+ type ConfigPreset = Omit<ReactRouterConfig, ExcludedConfigPresetKey>;
9
+ type Preset = {
10
+ name: string;
11
+ reactRouterConfig?: (args: {
12
+ reactRouterUserConfig: ReactRouterConfig;
13
+ }) => ConfigPreset | Promise<ConfigPreset>;
14
+ reactRouterConfigResolved?: (args: {
15
+ reactRouterConfig: ResolvedReactRouterConfig;
16
+ }) => void | Promise<void>;
17
+ };
18
+ declare const branchRouteProperties: readonly ["id", "path", "file", "index"];
19
+ type BranchRoute = Pick<RouteManifestEntry, (typeof branchRouteProperties)[number]>;
20
+ type ServerBundlesFunction = (args: {
21
+ branch: BranchRoute[];
22
+ }) => string | Promise<string>;
23
+ type BaseBuildManifest = {
24
+ routes: RouteManifest;
25
+ };
26
+ type DefaultBuildManifest = BaseBuildManifest & {
27
+ serverBundles?: never;
28
+ routeIdToServerBundleId?: never;
29
+ };
30
+ type ServerBundlesBuildManifest = BaseBuildManifest & {
31
+ serverBundles: {
32
+ [serverBundleId: string]: {
33
+ id: string;
34
+ file: string;
35
+ };
36
+ };
37
+ routeIdToServerBundleId: Record<string, string>;
38
+ };
39
+ type ServerModuleFormat = "esm" | "cjs";
40
+ interface FutureConfig {
41
+ unstable_optimizeDeps: boolean;
42
+ }
43
+ type SplitRouteModulesOption = boolean | "enforce";
44
+ type BuildManifest = DefaultBuildManifest | ServerBundlesBuildManifest;
45
+ type BuildEndHook = (args: {
46
+ buildManifest: BuildManifest | undefined;
47
+ reactRouterConfig: ResolvedReactRouterConfig;
48
+ viteConfig: Vite.ResolvedConfig;
49
+ }) => void | Promise<void>;
50
+ type PrerenderPaths = boolean | Array<string> | ((args: {
51
+ getStaticPaths: () => string[];
52
+ }) => Array<string> | Promise<Array<string>>);
53
+ /**
54
+ * Config to be exported via the default export from `react-router.config.ts`.
55
+ */
56
+ type ReactRouterConfig = {
57
+ /**
58
+ * The path to the `app` directory, relative to the root directory. Defaults
59
+ * to `"app"`.
60
+ */
61
+ appDirectory?: string;
62
+ /**
63
+ * The output format of the server build. Defaults to "esm".
64
+ */
65
+ serverModuleFormat?: ServerModuleFormat;
66
+ /**
67
+ * Enabled future flags
68
+ */
69
+ future?: [keyof FutureConfig] extends [never] ? {
70
+ [key: string]: never;
71
+ } : Partial<FutureConfig>;
72
+ /**
73
+ * Automatically split route modules into multiple chunks when possible.
74
+ *
75
+ * This can be set to `false` to keep route modules in a single chunk, or
76
+ * `"enforce"` to require all routes to be splittable.
77
+ *
78
+ * Defaults to `true`.
79
+ */
80
+ splitRouteModules?: SplitRouteModulesOption;
81
+ /**
82
+ * The React Router app basename. Defaults to `"/"`.
83
+ */
84
+ basename?: string;
85
+ /**
86
+ * The path to the build directory, relative to the project. Defaults to
87
+ * `"build"`.
88
+ */
89
+ buildDirectory?: string;
90
+ /**
91
+ * A function that is called after the full React Router build is complete.
92
+ */
93
+ buildEnd?: BuildEndHook;
94
+ /**
95
+ * An array of URLs to prerender to HTML files at build time. Can also be a
96
+ * function returning an array to dynamically generate URLs.
97
+ *
98
+ * `concurrency` defaults to 1, which means "no concurrency" - fully serial execution.
99
+ * Setting it to a value more than 1 enables concurrent prerendering.
100
+ * Setting it to a value higher than one can increase the speed of the build,
101
+ * but may consume more resources, and send more concurrent requests to the
102
+ * server/CMS.
103
+ */
104
+ prerender?: PrerenderPaths | {
105
+ paths: PrerenderPaths;
106
+ concurrency?: number;
107
+ };
108
+ /**
109
+ * An array of React Router plugin config presets to ease integration with
110
+ * other platforms and tools.
111
+ */
112
+ presets?: Array<Preset>;
113
+ /**
114
+ * Control the "Lazy Route Discovery" behavior
115
+ *
116
+ * - `routeDiscovery.mode`: By default, this resolves to `lazy` which will
117
+ * lazily discover routes as the user navigates around your application.
118
+ * You can set this to `initial` to opt-out of this behavior and load all
119
+ * routes with the initial HTML document load.
120
+ * - `routeDiscovery.manifestPath`: The path to serve the manifest file from.
121
+ * Only applies to `mode: "lazy"` and defaults to `/__manifest`.
122
+ */
123
+ routeDiscovery?: {
124
+ mode: "lazy";
125
+ manifestPath?: string;
126
+ } | {
127
+ mode: "initial";
128
+ };
129
+ /**
130
+ * The file name of the server build output. This file
131
+ * should end in a `.js` extension and should be deployed to your server.
132
+ * Defaults to `"index.js"`.
133
+ */
134
+ serverBuildFile?: string;
135
+ /**
136
+ * A function for assigning routes to different server bundles. This
137
+ * function should return a server bundle ID which will be used as the
138
+ * bundle's directory name within the server build directory.
139
+ */
140
+ serverBundles?: ServerBundlesFunction;
141
+ /**
142
+ * Enable server-side rendering for your application. Disable to use "SPA
143
+ * Mode", which will request the `/` path at build-time and save it as an
144
+ * `index.html` file with your assets so your application can be deployed as a
145
+ * SPA without server-rendering. Default's to `true`.
146
+ */
147
+ ssr?: boolean;
148
+ /**
149
+ * Enable subresource integrity hashes on asset script tags. Defaults to
150
+ * `false`.
151
+ */
152
+ subResourceIntegrity?: boolean;
153
+ /**
154
+ * An array of allowed origin hosts for action submissions to UI routes (does not apply
155
+ * to resource routes). Supports micromatch glob patterns (`*` to match one segment,
156
+ * `**` to match multiple).
157
+ *
158
+ * ```tsx
159
+ * export default {
160
+ * allowedActionOrigins: [
161
+ * "example.com",
162
+ * "*.example.com", // sub.example.com
163
+ * "**.example.com", // sub.domain.example.com
164
+ * ],
165
+ * } satisfies Config;
166
+ * ```
167
+ *
168
+ * If you need to set this value at runtime, you can do in by setting the value
169
+ * on the server build in your custom server. For example, when using `express`:
170
+ *
171
+ * ```ts
172
+ * import express from "express";
173
+ * import { createRequestHandler } from "@react-router/express";
174
+ * import type { ServerBuild } from "react-router";
175
+ *
176
+ * export const app = express();
177
+ *
178
+ * async function getBuild() {
179
+ * let build: ServerBuild = await import(
180
+ * "virtual:react-router/server-build"
181
+ * );
182
+ * return {
183
+ * ...build,
184
+ * allowedActionOrigins:
185
+ * process.env.NODE_ENV === "development"
186
+ * ? undefined
187
+ * : ["staging.example.com", "www.example.com"],
188
+ * };
189
+ * }
190
+ *
191
+ * app.use(createRequestHandler({ build: getBuild }));
192
+ */
193
+ allowedActionOrigins?: string[];
194
+ };
195
+ type ResolvedReactRouterConfig = Readonly<{
196
+ /**
197
+ * The absolute path to the application source directory.
198
+ */
199
+ appDirectory: string;
200
+ /**
201
+ * The React Router app basename. Defaults to `"/"`.
202
+ */
203
+ basename: string;
204
+ /**
205
+ * The absolute path to the build directory.
206
+ */
207
+ buildDirectory: string;
208
+ /**
209
+ * A function that is called after the full React Router build is complete.
210
+ */
211
+ buildEnd?: BuildEndHook;
212
+ /**
213
+ * Enabled future flags
214
+ */
215
+ future: FutureConfig;
216
+ /**
217
+ * Whether to automatically split route modules into multiple chunks when
218
+ * possible.
219
+ */
220
+ splitRouteModules: SplitRouteModulesOption;
221
+ /**
222
+ * An array of URLs to prerender to HTML files at build time. Can also be a
223
+ * function returning an array to dynamically generate URLs.
224
+ */
225
+ prerender: ReactRouterConfig["prerender"];
226
+ /**
227
+ * Control the "Lazy Route Discovery" behavior
228
+ *
229
+ * - `routeDiscovery.mode`: By default, this resolves to `lazy` which will
230
+ * lazily discover routes as the user navigates around your application.
231
+ * You can set this to `initial` to opt-out of this behavior and load all
232
+ * routes with the initial HTML document load.
233
+ * - `routeDiscovery.manifestPath`: The path to serve the manifest file from.
234
+ * Only applies to `mode: "lazy"` and defaults to `/__manifest`.
235
+ */
236
+ routeDiscovery: ReactRouterConfig["routeDiscovery"];
237
+ /**
238
+ * An object of all available routes, keyed by route id.
239
+ */
240
+ routes: RouteManifest;
241
+ /**
242
+ * The file name of the server build output. This file
243
+ * should end in a `.js` extension and should be deployed to your server.
244
+ * Defaults to `"index.js"`.
245
+ */
246
+ serverBuildFile: string;
247
+ /**
248
+ * A function for assigning routes to different server bundles. This
249
+ * function should return a server bundle ID which will be used as the
250
+ * bundle's directory name within the server build directory.
251
+ */
252
+ serverBundles?: ServerBundlesFunction;
253
+ /**
254
+ * The output format of the server build. Defaults to "esm".
255
+ */
256
+ serverModuleFormat: ServerModuleFormat;
257
+ /**
258
+ * Enable server-side rendering for your application. Disable to use "SPA
259
+ * Mode", which will request the `/` path at build-time and save it as an
260
+ * `index.html` file with your assets so your application can be deployed as a
261
+ * SPA without server-rendering. Default's to `true`.
262
+ */
263
+ ssr: boolean;
264
+ /**
265
+ * Whether to generate subresource integrity hashes for asset script tags.
266
+ */
267
+ subResourceIntegrity: boolean;
268
+ /**
269
+ * The allowed origins for actions / mutations. Does not apply to routes
270
+ * without a component. micromatch glob patterns are supported.
271
+ */
272
+ allowedActionOrigins: string[] | false;
273
+ /**
274
+ * The resolved array of route config entries exported from `routes.ts`
275
+ */
276
+ unstable_routeConfig: RouteConfigEntry[];
277
+ }>;
278
+ //#endregion
279
+ export { ServerBundlesFunction as i, Preset as n, ReactRouterConfig as r, BuildManifest as t };
package/dist/config.d.ts CHANGED
@@ -1,281 +1,3 @@
1
- import * as Vite from 'vite';
2
- import { R as RouteManifest, a as RouteManifestEntry, b as RouteConfigEntry } from './routes-CZR-bKRt.js';
3
- import 'valibot';
4
1
 
5
- declare const excludedConfigPresetKeys: readonly ["presets"];
6
- type ExcludedConfigPresetKey = (typeof excludedConfigPresetKeys)[number];
7
- type ConfigPreset = Omit<ReactRouterConfig, ExcludedConfigPresetKey>;
8
- type Preset = {
9
- name: string;
10
- reactRouterConfig?: (args: {
11
- reactRouterUserConfig: ReactRouterConfig;
12
- }) => ConfigPreset | Promise<ConfigPreset>;
13
- reactRouterConfigResolved?: (args: {
14
- reactRouterConfig: ResolvedReactRouterConfig;
15
- }) => void | Promise<void>;
16
- };
17
- declare const branchRouteProperties: readonly ["id", "path", "file", "index"];
18
- type BranchRoute = Pick<RouteManifestEntry, (typeof branchRouteProperties)[number]>;
19
- type ServerBundlesFunction = (args: {
20
- branch: BranchRoute[];
21
- }) => string | Promise<string>;
22
- type BaseBuildManifest = {
23
- routes: RouteManifest;
24
- };
25
- type DefaultBuildManifest = BaseBuildManifest & {
26
- serverBundles?: never;
27
- routeIdToServerBundleId?: never;
28
- };
29
- type ServerBundlesBuildManifest = BaseBuildManifest & {
30
- serverBundles: {
31
- [serverBundleId: string]: {
32
- id: string;
33
- file: string;
34
- };
35
- };
36
- routeIdToServerBundleId: Record<string, string>;
37
- };
38
- type ServerModuleFormat = "esm" | "cjs";
39
- interface FutureConfig {
40
- unstable_optimizeDeps: boolean;
41
- v8_passThroughRequests: boolean;
42
- v8_trailingSlashAwareDataRequests: boolean;
43
- /**
44
- * Prerender with Vite Preview server
45
- */
46
- unstable_previewServerPrerendering?: boolean;
47
- /**
48
- * Enable route middleware
49
- */
50
- v8_middleware: boolean;
51
- /**
52
- * Automatically split route modules into multiple chunks when possible.
53
- */
54
- v8_splitRouteModules: boolean | "enforce";
55
- /**
56
- * Use Vite Environment API
57
- */
58
- v8_viteEnvironmentApi: boolean;
59
- }
60
- type BuildManifest = DefaultBuildManifest | ServerBundlesBuildManifest;
61
- type BuildEndHook = (args: {
62
- buildManifest: BuildManifest | undefined;
63
- reactRouterConfig: ResolvedReactRouterConfig;
64
- viteConfig: Vite.ResolvedConfig;
65
- }) => void | Promise<void>;
66
- type PrerenderPaths = boolean | Array<string> | ((args: {
67
- getStaticPaths: () => string[];
68
- }) => Array<string> | Promise<Array<string>>);
69
- /**
70
- * Config to be exported via the default export from `react-router.config.ts`.
71
- */
72
- type ReactRouterConfig = {
73
- /**
74
- * The path to the `app` directory, relative to the root directory. Defaults
75
- * to `"app"`.
76
- */
77
- appDirectory?: string;
78
- /**
79
- * The output format of the server build. Defaults to "esm".
80
- */
81
- serverModuleFormat?: ServerModuleFormat;
82
- /**
83
- * Enabled future flags
84
- */
85
- future?: [keyof FutureConfig] extends [never] ? {
86
- [key: string]: never;
87
- } : Partial<FutureConfig>;
88
- /**
89
- * The React Router app basename. Defaults to `"/"`.
90
- */
91
- basename?: string;
92
- /**
93
- * The path to the build directory, relative to the project. Defaults to
94
- * `"build"`.
95
- */
96
- buildDirectory?: string;
97
- /**
98
- * A function that is called after the full React Router build is complete.
99
- */
100
- buildEnd?: BuildEndHook;
101
- /**
102
- * An array of URLs to prerender to HTML files at build time. Can also be a
103
- * function returning an array to dynamically generate URLs.
104
- *
105
- * `concurrency` defaults to 1, which means "no concurrency" - fully serial execution.
106
- * Setting it to a value more than 1 enables concurrent prerendering.
107
- * Setting it to a value higher than one can increase the speed of the build,
108
- * but may consume more resources, and send more concurrent requests to the
109
- * server/CMS.
110
- */
111
- prerender?: PrerenderPaths | {
112
- paths: PrerenderPaths;
113
- concurrency?: number;
114
- };
115
- /**
116
- * An array of React Router plugin config presets to ease integration with
117
- * other platforms and tools.
118
- */
119
- presets?: Array<Preset>;
120
- /**
121
- * Control the "Lazy Route Discovery" behavior
122
- *
123
- * - `routeDiscovery.mode`: By default, this resolves to `lazy` which will
124
- * lazily discover routes as the user navigates around your application.
125
- * You can set this to `initial` to opt-out of this behavior and load all
126
- * routes with the initial HTML document load.
127
- * - `routeDiscovery.manifestPath`: The path to serve the manifest file from.
128
- * Only applies to `mode: "lazy"` and defaults to `/__manifest`.
129
- */
130
- routeDiscovery?: {
131
- mode: "lazy";
132
- manifestPath?: string;
133
- } | {
134
- mode: "initial";
135
- };
136
- /**
137
- * The file name of the server build output. This file
138
- * should end in a `.js` extension and should be deployed to your server.
139
- * Defaults to `"index.js"`.
140
- */
141
- serverBuildFile?: string;
142
- /**
143
- * A function for assigning routes to different server bundles. This
144
- * function should return a server bundle ID which will be used as the
145
- * bundle's directory name within the server build directory.
146
- */
147
- serverBundles?: ServerBundlesFunction;
148
- /**
149
- * Enable server-side rendering for your application. Disable to use "SPA
150
- * Mode", which will request the `/` path at build-time and save it as an
151
- * `index.html` file with your assets so your application can be deployed as a
152
- * SPA without server-rendering. Default's to `true`.
153
- */
154
- ssr?: boolean;
155
- /**
156
- * Enable subresource integrity hashes on asset script tags. Defaults to
157
- * `false`.
158
- */
159
- subResourceIntegrity?: boolean;
160
- /**
161
- * An array of allowed origin hosts for action submissions to UI routes (does not apply
162
- * to resource routes). Supports micromatch glob patterns (`*` to match one segment,
163
- * `**` to match multiple).
164
- *
165
- * ```tsx
166
- * export default {
167
- * allowedActionOrigins: [
168
- * "example.com",
169
- * "*.example.com", // sub.example.com
170
- * "**.example.com", // sub.domain.example.com
171
- * ],
172
- * } satisfies Config;
173
- * ```
174
- *
175
- * If you need to set this value at runtime, you can do in by setting the value
176
- * on the server build in your custom server. For example, when using `express`:
177
- *
178
- * ```ts
179
- * import express from "express";
180
- * import { createRequestHandler } from "@react-router/express";
181
- * import type { ServerBuild } from "react-router";
182
- *
183
- * export const app = express();
184
- *
185
- * async function getBuild() {
186
- * let build: ServerBuild = await import(
187
- * "virtual:react-router/server-build"
188
- * );
189
- * return {
190
- * ...build,
191
- * allowedActionOrigins:
192
- * process.env.NODE_ENV === "development"
193
- * ? undefined
194
- * : ["staging.example.com", "www.example.com"],
195
- * };
196
- * }
197
- *
198
- * app.use(createRequestHandler({ build: getBuild }));
199
- */
200
- allowedActionOrigins?: string[];
201
- };
202
- type ResolvedReactRouterConfig = Readonly<{
203
- /**
204
- * The absolute path to the application source directory.
205
- */
206
- appDirectory: string;
207
- /**
208
- * The React Router app basename. Defaults to `"/"`.
209
- */
210
- basename: string;
211
- /**
212
- * The absolute path to the build directory.
213
- */
214
- buildDirectory: string;
215
- /**
216
- * A function that is called after the full React Router build is complete.
217
- */
218
- buildEnd?: BuildEndHook;
219
- /**
220
- * Enabled future flags
221
- */
222
- future: FutureConfig;
223
- /**
224
- * An array of URLs to prerender to HTML files at build time. Can also be a
225
- * function returning an array to dynamically generate URLs.
226
- */
227
- prerender: ReactRouterConfig["prerender"];
228
- /**
229
- * Control the "Lazy Route Discovery" behavior
230
- *
231
- * - `routeDiscovery.mode`: By default, this resolves to `lazy` which will
232
- * lazily discover routes as the user navigates around your application.
233
- * You can set this to `initial` to opt-out of this behavior and load all
234
- * routes with the initial HTML document load.
235
- * - `routeDiscovery.manifestPath`: The path to serve the manifest file from.
236
- * Only applies to `mode: "lazy"` and defaults to `/__manifest`.
237
- */
238
- routeDiscovery: ReactRouterConfig["routeDiscovery"];
239
- /**
240
- * An object of all available routes, keyed by route id.
241
- */
242
- routes: RouteManifest;
243
- /**
244
- * The file name of the server build output. This file
245
- * should end in a `.js` extension and should be deployed to your server.
246
- * Defaults to `"index.js"`.
247
- */
248
- serverBuildFile: string;
249
- /**
250
- * A function for assigning routes to different server bundles. This
251
- * function should return a server bundle ID which will be used as the
252
- * bundle's directory name within the server build directory.
253
- */
254
- serverBundles?: ServerBundlesFunction;
255
- /**
256
- * The output format of the server build. Defaults to "esm".
257
- */
258
- serverModuleFormat: ServerModuleFormat;
259
- /**
260
- * Enable server-side rendering for your application. Disable to use "SPA
261
- * Mode", which will request the `/` path at build-time and save it as an
262
- * `index.html` file with your assets so your application can be deployed as a
263
- * SPA without server-rendering. Default's to `true`.
264
- */
265
- ssr: boolean;
266
- /**
267
- * Whether to generate subresource integrity hashes for asset script tags.
268
- */
269
- subResourceIntegrity: boolean;
270
- /**
271
- * The allowed origins for actions / mutations. Does not apply to routes
272
- * without a component. micromatch glob patterns are supported.
273
- */
274
- allowedActionOrigins: string[] | false;
275
- /**
276
- * The resolved array of route config entries exported from `routes.ts`
277
- */
278
- unstable_routeConfig: RouteConfigEntry[];
279
- }>;
280
-
281
- export type { BuildManifest, ReactRouterConfig as Config, Preset, ServerBundlesFunction };
2
+ import { i as ServerBundlesFunction, n as Preset, r as ReactRouterConfig, t as BuildManifest } from "./config-DvmRcD4Z.js";
3
+ export type { BuildManifest, ReactRouterConfig as Config, Preset, ServerBundlesFunction };
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v7.18.0
2
+ * @react-router/dev v8.0.0-pre.1
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8,21 +8,4 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- "use strict";
12
- var __defProp = Object.defineProperty;
13
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
14
- var __getOwnPropNames = Object.getOwnPropertyNames;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __copyProps = (to, from, except, desc) => {
17
- if (from && typeof from === "object" || typeof from === "function") {
18
- for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to, key) && key !== except)
20
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
- }
22
- return to;
23
- };
24
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
-
26
- // config.ts
27
- var config_exports = {};
28
- module.exports = __toCommonJS(config_exports);
11
+ export {};
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @react-router/dev v8.0.0-pre.1
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ import { g as preloadVite, h as getVite } from "./typegen-BNUacd46.js";
12
+ import { n as start, r as stop, t as getSession } from "./cli/index.js";
13
+ import colors from "picocolors";
14
+ //#region vite/dev.ts
15
+ async function dev(root, { clearScreen, config: configFile, cors, force, host, logLevel, mode, open, port, strictPort }) {
16
+ await preloadVite();
17
+ let server = await getVite().createServer({
18
+ root,
19
+ mode,
20
+ configFile,
21
+ server: {
22
+ open,
23
+ cors,
24
+ host,
25
+ port,
26
+ strictPort
27
+ },
28
+ optimizeDeps: { force },
29
+ clearScreen,
30
+ logLevel
31
+ });
32
+ if (!server.config.plugins.find((plugin) => plugin.name === "react-router" || plugin.name === "react-router/rsc")) {
33
+ console.error(colors.red("React Router Vite plugin not found in Vite config"));
34
+ process.exit(1);
35
+ }
36
+ await server.listen();
37
+ server.printUrls();
38
+ server.bindCLIShortcuts({
39
+ print: true,
40
+ customShortcuts: [{
41
+ key: "p",
42
+ description: "start/stop the profiler",
43
+ async action(server) {
44
+ if (getSession()) await stop(server.config.logger.info);
45
+ else await start(() => {
46
+ server.config.logger.info("Profiler started");
47
+ });
48
+ }
49
+ }]
50
+ });
51
+ }
52
+ //#endregion
53
+ export { dev };