-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
/
Copy pathbuild.ts
66 lines (60 loc) · 1.66 KB
/
build.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import type { ActionFunctionArgs, LoaderFunctionArgs } from "../router/utils";
import type {
AssetsManifest,
CriticalCss,
EntryContext,
FutureConfig,
} from "../dom/ssr/entry";
import type { ServerRouteManifest } from "./routes";
import type { AppLoadContext } from "./data";
type OptionalCriticalCss = CriticalCss | undefined;
/**
* The output of the compiler for the server build.
*/
export interface ServerBuild {
entry: {
module: ServerEntryModule;
};
routes: ServerRouteManifest;
assets: AssetsManifest;
basename?: string;
publicPath: string;
assetsBuildDirectory: string;
future: FutureConfig;
ssr: boolean;
unstable_getCriticalCss?: (args: {
pathname: string;
}) => OptionalCriticalCss | Promise<OptionalCriticalCss>;
/**
* @deprecated This is now done via a custom header during prerendering
*/
isSpaMode: boolean;
prerender: string[];
}
export interface HandleDocumentRequestFunction {
(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
context: EntryContext,
loadContext: AppLoadContext
): Promise<Response> | Response;
}
export interface HandleDataRequestFunction {
(response: Response, args: LoaderFunctionArgs | ActionFunctionArgs):
| Promise<Response>
| Response;
}
export interface HandleErrorFunction {
(error: unknown, args: LoaderFunctionArgs | ActionFunctionArgs): void;
}
/**
* A module that serves as the entry point for a Remix app during server
* rendering.
*/
export interface ServerEntryModule {
default: HandleDocumentRequestFunction;
handleDataRequest?: HandleDataRequestFunction;
handleError?: HandleErrorFunction;
streamTimeout?: number;
}