@sveltejs/kit 3.0.0-next.2 → 3.0.0-next.21

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.
Files changed (195) hide show
  1. package/package.json +62 -36
  2. package/src/cli.js +15 -12
  3. package/src/constants.js +6 -1
  4. package/src/core/adapt/builder.js +66 -72
  5. package/src/core/adapt/index.js +17 -6
  6. package/src/core/config/index.js +134 -80
  7. package/src/core/config/options.js +295 -273
  8. package/src/core/config/types.d.ts +1 -1
  9. package/src/core/env.js +146 -16
  10. package/src/core/generate_manifest/index.js +18 -15
  11. package/src/core/postbuild/analyse.js +8 -20
  12. package/src/core/postbuild/crawl.js +22 -6
  13. package/src/core/postbuild/entities.js +8 -2
  14. package/src/core/postbuild/fallback.js +4 -2
  15. package/src/core/postbuild/prerender.js +222 -70
  16. package/src/core/postbuild/queue.js +2 -1
  17. package/src/core/sync/create_manifest_data/conflict.js +1 -1
  18. package/src/core/sync/create_manifest_data/index.js +82 -62
  19. package/src/core/sync/sync.js +40 -31
  20. package/src/core/sync/ts.js +1 -1
  21. package/src/core/sync/utils.js +22 -2
  22. package/src/core/sync/{write_non_ambient.js → write_app_types.js} +107 -58
  23. package/src/core/sync/write_client_manifest.js +14 -29
  24. package/src/core/sync/write_env.js +7 -5
  25. package/src/core/sync/write_server.js +37 -45
  26. package/src/core/sync/write_tsconfig/index.js +274 -0
  27. package/src/core/sync/write_tsconfig/test-app/package.json +7 -0
  28. package/src/core/sync/write_tsconfig/utils.js +77 -0
  29. package/src/core/sync/write_tsconfig/validate.js +128 -0
  30. package/src/core/sync/write_types/index.js +127 -123
  31. package/src/core/utils.js +30 -5
  32. package/src/exports/env/index.js +77 -0
  33. package/src/exports/env/public.d.ts +55 -0
  34. package/src/exports/hooks/index.js +3 -9
  35. package/src/exports/hooks/public.d.ts +195 -0
  36. package/src/exports/hooks/sequence.js +9 -6
  37. package/src/exports/index.js +52 -29
  38. package/src/exports/internal/client.js +5 -0
  39. package/src/exports/internal/env.js +8 -5
  40. package/src/exports/internal/index.js +1 -90
  41. package/src/exports/internal/{event.js → server/event.js} +2 -3
  42. package/src/exports/internal/server/index.js +37 -0
  43. package/src/exports/internal/server/telemetry.js +95 -0
  44. package/src/exports/internal/shared.js +90 -0
  45. package/src/exports/node/index.js +64 -22
  46. package/src/exports/params/index.js +70 -0
  47. package/src/exports/params/public.d.ts +63 -0
  48. package/src/exports/public.d.ts +50 -1733
  49. package/src/exports/remote/index.js +11 -0
  50. package/src/exports/remote/public.d.ts +519 -0
  51. package/src/exports/url.js +86 -0
  52. package/src/exports/vite/build/build_server.js +54 -65
  53. package/src/exports/vite/build/remote.js +24 -19
  54. package/src/exports/vite/build/utils.js +0 -8
  55. package/src/exports/vite/dev/index.js +218 -146
  56. package/src/exports/vite/index.js +1590 -858
  57. package/src/exports/vite/module_ids.js +2 -2
  58. package/src/exports/vite/preview/index.js +40 -32
  59. package/src/exports/vite/public.d.ts +588 -0
  60. package/src/exports/vite/utils.js +84 -46
  61. package/src/pathname.js +55 -0
  62. package/src/runner.js +15 -0
  63. package/src/runtime/app/env/internal.js +4 -4
  64. package/src/runtime/app/env/types.d.ts +1 -1
  65. package/src/runtime/app/environment/index.js +3 -3
  66. package/src/runtime/app/{forms.js → forms/index.js} +73 -42
  67. package/src/runtime/app/forms/public.d.ts +2 -0
  68. package/src/runtime/app/forms/types.d.ts +56 -0
  69. package/src/runtime/app/internal/transport.js +53 -0
  70. package/src/runtime/app/manifest/index.js +1 -0
  71. package/src/runtime/app/{navigation.js → navigation/index.js} +2 -1
  72. package/src/runtime/app/navigation/public.d.ts +237 -0
  73. package/src/runtime/app/paths/client.js +37 -37
  74. package/src/runtime/app/paths/index.js +1 -1
  75. package/src/runtime/app/paths/internal/client.js +34 -2
  76. package/src/runtime/app/paths/internal/server.js +6 -23
  77. package/src/runtime/app/paths/internal.d.ts +3 -0
  78. package/src/runtime/app/paths/public.d.ts +1 -29
  79. package/src/runtime/app/paths/server.js +36 -17
  80. package/src/runtime/app/paths/types.d.ts +11 -19
  81. package/src/runtime/app/server/index.js +2 -2
  82. package/src/runtime/app/server/public.d.ts +201 -0
  83. package/src/runtime/app/server/remote/command.js +13 -11
  84. package/src/runtime/app/server/remote/form.js +61 -39
  85. package/src/runtime/app/server/remote/prerender.js +45 -45
  86. package/src/runtime/app/server/remote/query.js +106 -108
  87. package/src/runtime/app/server/remote/requested.js +27 -19
  88. package/src/runtime/app/server/remote/shared.js +76 -76
  89. package/src/runtime/app/service-worker/index.js +24 -0
  90. package/src/runtime/app/state/client.js +4 -2
  91. package/src/runtime/app/state/index.js +7 -5
  92. package/src/runtime/app/state/public.d.ts +72 -0
  93. package/src/runtime/app/state/server.js +3 -0
  94. package/src/runtime/app/stores.js +15 -78
  95. package/src/runtime/client/bundle.js +1 -1
  96. package/src/runtime/client/client-entry.js +3 -0
  97. package/src/runtime/client/client.js +1336 -648
  98. package/src/runtime/client/constants.js +3 -6
  99. package/src/runtime/client/entry.js +24 -3
  100. package/src/runtime/client/fetcher.js +25 -25
  101. package/src/runtime/client/ndjson.js +1 -1
  102. package/src/runtime/client/parse.js +1 -1
  103. package/src/runtime/client/payload.js +17 -0
  104. package/src/runtime/client/remote-functions/cache.svelte.js +3 -1
  105. package/src/runtime/client/remote-functions/command.svelte.js +37 -61
  106. package/src/runtime/client/remote-functions/form.svelte.js +267 -178
  107. package/src/runtime/client/remote-functions/prerender.svelte.js +32 -11
  108. package/src/runtime/client/remote-functions/query/index.js +10 -17
  109. package/src/runtime/client/remote-functions/query/instance.svelte.js +64 -18
  110. package/src/runtime/client/remote-functions/query/proxy.js +5 -5
  111. package/src/runtime/client/remote-functions/query-batch.svelte.js +61 -70
  112. package/src/runtime/client/remote-functions/query-live/index.js +1 -1
  113. package/src/runtime/client/remote-functions/query-live/instance.svelte.js +63 -21
  114. package/src/runtime/client/remote-functions/query-live/iterator.js +15 -12
  115. package/src/runtime/client/remote-functions/query-live/proxy.js +2 -12
  116. package/src/runtime/client/remote-functions/shared.svelte.js +90 -65
  117. package/src/runtime/client/snapshots.js +147 -0
  118. package/src/runtime/client/state.svelte.js +94 -55
  119. package/src/runtime/client/stream.js +3 -2
  120. package/src/runtime/client/types.d.ts +13 -9
  121. package/src/runtime/client/utils.js +22 -110
  122. package/src/runtime/components/root.svelte +56 -0
  123. package/src/runtime/env/dynamic/private.js +7 -0
  124. package/src/runtime/env/dynamic/public.js +7 -0
  125. package/src/runtime/env/static/private.js +6 -0
  126. package/src/runtime/env/static/public.js +6 -0
  127. package/src/runtime/form-utils.js +172 -61
  128. package/src/runtime/pathname.js +20 -32
  129. package/src/runtime/props.svelte.js +72 -0
  130. package/src/runtime/server/constants.js +0 -3
  131. package/src/runtime/server/cookie.js +72 -55
  132. package/src/runtime/server/csrf.js +65 -0
  133. package/src/runtime/server/data/index.js +49 -53
  134. package/src/runtime/server/dev.js +22 -0
  135. package/src/runtime/server/endpoint.js +6 -7
  136. package/src/runtime/server/env_module.js +0 -5
  137. package/src/runtime/server/errors.js +160 -0
  138. package/src/runtime/server/fetch.js +32 -39
  139. package/src/runtime/server/index.js +90 -64
  140. package/src/runtime/server/internal.js +71 -0
  141. package/src/runtime/server/page/actions.js +85 -64
  142. package/src/runtime/server/page/crypto.js +2 -2
  143. package/src/runtime/server/page/csp.js +88 -104
  144. package/src/runtime/server/page/data_serializer.js +24 -25
  145. package/src/runtime/server/page/index.js +36 -53
  146. package/src/runtime/server/page/load_data.js +50 -57
  147. package/src/runtime/server/page/render.js +173 -239
  148. package/src/runtime/server/page/respond_with_error.js +17 -31
  149. package/src/runtime/server/page/serialize_data.js +2 -13
  150. package/src/runtime/server/page/server_routing.js +85 -26
  151. package/src/runtime/server/remote-functions.js +640 -0
  152. package/src/runtime/server/respond.js +190 -131
  153. package/src/runtime/server/sourcemaps.js +183 -0
  154. package/src/runtime/server/state.js +53 -0
  155. package/src/runtime/server/utils.js +13 -155
  156. package/src/runtime/shared.js +20 -40
  157. package/src/runtime/utils.js +3 -0
  158. package/src/types/ambient-private.d.ts +11 -1
  159. package/src/types/ambient.d.ts +87 -36
  160. package/src/types/global-private.d.ts +25 -25
  161. package/src/types/internal.d.ts +163 -157
  162. package/src/types/private.d.ts +41 -1
  163. package/src/utils/error.js +28 -4
  164. package/src/utils/escape.js +9 -25
  165. package/src/utils/features.js +1 -1
  166. package/src/utils/filesystem.js +1 -23
  167. package/src/utils/fork.js +7 -2
  168. package/src/utils/hash.js +21 -0
  169. package/src/utils/http.js +8 -7
  170. package/src/utils/import.js +9 -2
  171. package/src/utils/imports.js +83 -0
  172. package/src/utils/mime.js +9 -0
  173. package/src/utils/page_nodes.js +6 -7
  174. package/src/utils/params.js +67 -0
  175. package/src/utils/regex.js +9 -0
  176. package/src/utils/routing.js +145 -73
  177. package/src/utils/shared-iterator.js +5 -0
  178. package/src/utils/streaming.js +14 -4
  179. package/src/utils/url.js +33 -2
  180. package/src/version.js +1 -1
  181. package/types/index.d.ts +2616 -2433
  182. package/types/index.d.ts.map +120 -106
  183. package/src/core/sync/write_ambient.js +0 -18
  184. package/src/core/sync/write_root.js +0 -148
  185. package/src/core/sync/write_tsconfig.js +0 -250
  186. package/src/exports/internal/server.js +0 -22
  187. package/src/exports/node/polyfills.js +0 -30
  188. package/src/runtime/server/app.js +0 -9
  189. package/src/runtime/server/remote.js +0 -457
  190. package/src/runtime/shared-server.js +0 -7
  191. package/src/runtime/telemetry/otel.js +0 -21
  192. package/src/runtime/telemetry/record_span.js +0 -65
  193. package/src/types/synthetic/$lib.md +0 -5
  194. /package/src/exports/internal/{remote-functions.js → server/remote-functions.js} +0 -0
  195. /package/src/{runtime/telemetry/noop.js → telemetry.js} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { Redirect } from '@sveltejs/kit/internal';
2
2
  import { render_response } from './render.js';
3
3
  import { load_data, load_server_data } from './load_data.js';
4
- import { handle_error_and_jsonify, static_error_page, redirect_response } from '../utils.js';
5
- import { get_status } from '../../../utils/error.js';
4
+ import { redirect_response } from '../utils.js';
5
+ import { handle_error_and_jsonify, static_error_page } from '../errors.js';
6
6
  import { PageNodes } from '../../../utils/page_nodes.js';
7
7
  import { server_data_serializer } from './data_serializer.js';
8
8
 
@@ -12,48 +12,38 @@ import { server_data_serializer } from './data_serializer.js';
12
12
 
13
13
  /**
14
14
  * @param {{
15
- * event: import('@sveltejs/kit').RequestEvent;
16
- * event_state: import('types').RequestState;
15
+ * event: import('$app/server').RequestEvent;
16
+ * state: import('types').RequestState;
17
17
  * options: import('types').SSROptions;
18
18
  * manifest: import('@sveltejs/kit').SSRManifest;
19
- * state: import('types').SSRState;
20
- * status: number;
21
19
  * error: unknown;
22
20
  * resolve_opts: import('types').RequiredResolveOptions;
23
21
  * }} opts
24
22
  */
25
- export async function respond_with_error({
26
- event,
27
- event_state,
28
- options,
29
- manifest,
30
- state,
31
- status,
32
- error,
33
- resolve_opts
34
- }) {
23
+ export async function respond_with_error({ event, state, options, manifest, error, resolve_opts }) {
35
24
  // reroute to the fallback page to prevent an infinite chain of requests.
36
25
  if (event.request.headers.get('x-sveltekit-error')) {
37
- return static_error_page(options, status, /** @type {Error} */ (error).message);
26
+ const transformed = await handle_error_and_jsonify(event, state, options, error);
27
+ return static_error_page(options, transformed.status, transformed.message);
38
28
  }
39
29
 
40
30
  /** @type {import('./types.js').Fetched[]} */
41
31
  const fetched = [];
42
-
43
32
  try {
44
33
  const branch = [];
45
34
  const default_layout = await manifest._.nodes[0](); // 0 is always the root layout
46
35
  const nodes = new PageNodes([default_layout]);
47
36
  const ssr = nodes.ssr();
48
37
  const csr = nodes.csr();
49
- const data_serializer = server_data_serializer(event, event_state, options);
38
+ const data_serializer = server_data_serializer(event, state, options);
39
+ // Do this here first in case the awaits below before rendering themselves error
40
+ const transformed = await handle_error_and_jsonify(event, state, options, error);
50
41
 
51
42
  if (ssr) {
52
43
  state.error = true;
53
44
 
54
45
  const server_data_promise = load_server_data({
55
46
  event,
56
- event_state,
57
47
  state,
58
48
  node: default_layout,
59
49
  // eslint-disable-next-line @typescript-eslint/require-await
@@ -65,14 +55,13 @@ export async function respond_with_error({
65
55
 
66
56
  const data = await load_data({
67
57
  event,
68
- event_state,
58
+ state,
69
59
  fetched,
70
60
  node: default_layout,
71
61
  // eslint-disable-next-line @typescript-eslint/require-await
72
62
  parent: async () => ({}),
73
63
  resolve_opts,
74
64
  server_data_promise,
75
- state,
76
65
  csr
77
66
  });
78
67
 
@@ -93,18 +82,17 @@ export async function respond_with_error({
93
82
  return await render_response({
94
83
  options,
95
84
  manifest,
96
- state,
97
85
  page_config: {
98
86
  ssr,
99
87
  csr
100
88
  },
101
- status,
102
- error: await handle_error_and_jsonify(event, event_state, options, error),
89
+ status: transformed.status,
90
+ error: transformed,
103
91
  branch,
104
92
  error_components: [],
105
93
  fetched,
106
94
  event,
107
- event_state,
95
+ state,
108
96
  resolve_opts,
109
97
  data_serializer
110
98
  });
@@ -115,10 +103,8 @@ export async function respond_with_error({
115
103
  return redirect_response(e.status, e.location);
116
104
  }
117
105
 
118
- return static_error_page(
119
- options,
120
- get_status(e),
121
- (await handle_error_and_jsonify(event, event_state, options, e)).message
122
- );
106
+ const transformed = await handle_error_and_jsonify(event, state, options, e);
107
+
108
+ return static_error_page(options, transformed.status, transformed.message);
123
109
  }
124
110
  }
@@ -1,5 +1,5 @@
1
1
  import { escape_html } from '../../../utils/escape.js';
2
- import { hash } from '../../../utils/hash.js';
2
+ import { hash_request } from '../../../utils/hash.js';
3
3
 
4
4
  /**
5
5
  * Inside a script element, only `</script` and `<!--` hold special meaning to the HTML parser.
@@ -78,18 +78,7 @@ export function serialize_data(fetched, filter, prerendering = false) {
78
78
  }
79
79
 
80
80
  if (fetched.request_headers || fetched.request_body) {
81
- /** @type {import('types').StrictBody[]} */
82
- const values = [];
83
-
84
- if (fetched.request_headers) {
85
- values.push([...new Headers(fetched.request_headers)].join(','));
86
- }
87
-
88
- if (fetched.request_body) {
89
- values.push(fetched.request_body);
90
- }
91
-
92
- attrs.push(`data-hash="${hash(...values)}"`);
81
+ attrs.push(`data-hash="${hash_request(fetched.request_headers, fetched.request_body)}"`);
93
82
  }
94
83
 
95
84
  // Compute the time the response should be cached, taking into account max-age and age.
@@ -1,4 +1,6 @@
1
- import { base, assets, relative } from '$app/paths/internal/server';
1
+ /** @import { SSRManifest } from '@sveltejs/kit' */
2
+ import { base, assets } from '#app/paths';
3
+ import { relative } from '$app/paths/internal/server';
2
4
  import { text } from '@sveltejs/kit';
3
5
  import { s } from '../../../utils/misc.js';
4
6
  import { find_route } from '../../../utils/routing.js';
@@ -7,19 +9,19 @@ import { get_relative_path } from '../../utils.js';
7
9
  /**
8
10
  * @param {import('types').SSRClientRoute} route
9
11
  * @param {URL} url
10
- * @param {import('@sveltejs/kit').SSRManifest} manifest
12
+ * @param {NonNullable<SSRManifest['_']['client']>} client
11
13
  * @returns {string}
12
14
  */
13
- export function generate_route_object(route, url, manifest) {
15
+ export function generate_route_object(route, url, client) {
14
16
  const { errors, layouts, leaf } = route;
15
17
 
16
18
  const nodes = [...errors, ...layouts.map((l) => l?.[1]), leaf[1]]
17
19
  .filter((n) => typeof n === 'number')
18
- .map((n) => `'${n}': () => ${create_client_import(manifest._.client.nodes?.[n], url)}`)
20
+ .map((n) => `'${n}': () => ${create_client_import(client.nodes?.[n], url)}`)
19
21
  .join(',\n\t\t');
20
22
 
21
23
  // stringified version of
22
- /** @type {import('types').CSRRouteServer} */
24
+ /* @type {import('types').CSRRouteServer} */
23
25
  return [
24
26
  `{\n\tid: ${s(route.id)}`,
25
27
  `errors: ${s(route.errors)}`,
@@ -60,41 +62,98 @@ function create_client_import(import_path, url) {
60
62
  /**
61
63
  * @param {string} resolved_path
62
64
  * @param {URL} url
63
- * @param {import('@sveltejs/kit').SSRManifest} manifest
65
+ * @param {SSRManifest} manifest
64
66
  * @returns {Promise<Response>}
65
67
  */
66
68
  export async function resolve_route(resolved_path, url, manifest) {
67
- if (!manifest._.client.routes) {
69
+ if (!manifest._.client?.routes) {
68
70
  return text('Server-side route resolution disabled', { status: 400 });
69
71
  }
70
72
 
71
- const matchers = await manifest._.matchers();
72
- const result = find_route(resolved_path, manifest._.client.routes, matchers);
73
+ try {
74
+ const matchers = await manifest._.matchers();
75
+ const result = find_route(resolved_path, manifest._.client.routes, matchers);
76
+
77
+ return create_server_routing_response(
78
+ result?.route ?? null,
79
+ result?.params ?? {},
80
+ url,
81
+ manifest._.client
82
+ ).response;
83
+ } catch {
84
+ return text('Error resolving route', { status: 500 });
85
+ }
86
+ }
73
87
 
74
- return create_server_routing_response(result?.route ?? null, result?.params ?? {}, url, manifest)
75
- .response;
88
+ /**
89
+ * Resolve a route-ID resolution request (`/_app/routes/<id>/__route.js`) to a
90
+ * JS module containing the route's node loaders. Params are always `{}` since
91
+ * this endpoint exists to support `preloadCode(routeId)`, which doesn't need them.
92
+ *
93
+ * The module has one of three shapes, which the client uses to tell three cases apart:
94
+ *
95
+ * - `export const route = {...}` — a page route, with loaders to import
96
+ * - `export const endpoint_only = true` — a real route with no `+page`, so there is
97
+ * nothing to preload, but the client can cache that fact and stop asking
98
+ * - an empty module — no such route
99
+ *
100
+ * @param {string} route_id
101
+ * @param {URL} url
102
+ * @param {SSRManifest} manifest
103
+ * @returns {Response}
104
+ */
105
+ export function resolve_route_by_id(route_id, url, manifest) {
106
+ if (!manifest._.client?.routes) {
107
+ return text('Server-side route resolution disabled', { status: 400 });
108
+ }
109
+
110
+ try {
111
+ const route = manifest._.client.routes.find((r) => r.id === route_id);
112
+
113
+ if (route) {
114
+ return create_server_routing_response(route, null, url, manifest._.client).response;
115
+ }
116
+
117
+ // `client.routes` only contains routes with a `+page`, so a miss above doesn't mean the
118
+ // route doesn't exist — it might be a `+server.js`-only route. `_.routes` includes those
119
+ // (with `page: null`), so we can distinguish "exists but has no code" from "unknown".
120
+ if (manifest._.routes.some((r) => r.id === route_id && !r.page)) {
121
+ return text('export const endpoint_only = true;', { headers: js_headers() });
122
+ }
123
+
124
+ return create_server_routing_response(null, null, url, manifest._.client).response;
125
+ } catch {
126
+ return text('Error resolving route', { status: 500 });
127
+ }
128
+ }
129
+
130
+ function js_headers() {
131
+ return new Headers({
132
+ 'content-type': 'application/javascript; charset=utf-8'
133
+ });
76
134
  }
77
135
 
78
136
  /**
79
137
  * @param {import('types').SSRClientRoute | null} route
80
- * @param {Partial<Record<string, string>>} params
138
+ * @param {Partial<Record<string, string>> | null} params
81
139
  * @param {URL} url
82
- * @param {import('@sveltejs/kit').SSRManifest} manifest
140
+ * @param {NonNullable<SSRManifest['_']['client']>} client
83
141
  * @returns {{response: Response, body: string}}
84
142
  */
85
- export function create_server_routing_response(route, params, url, manifest) {
86
- const headers = new Headers({
87
- 'content-type': 'application/javascript; charset=utf-8'
88
- });
143
+ export function create_server_routing_response(route, params, url, client) {
144
+ const headers = js_headers();
145
+ let body = '';
89
146
 
90
147
  if (route) {
91
- const csr_route = generate_route_object(route, url, manifest);
92
- const body = `${create_css_import(route, url, manifest)}\nexport const route = ${csr_route}; export const params = ${JSON.stringify(params)};`;
148
+ const csr_route = generate_route_object(route, url, client);
149
+ body = `${create_css_import(route, url, client)}export const route = ${csr_route};`;
93
150
 
94
- return { response: text(body, { headers }), body };
95
- } else {
96
- return { response: text('', { headers }), body: '' };
151
+ if (params !== null) {
152
+ body += `\nexport const params = ${JSON.stringify(params)}`;
153
+ }
97
154
  }
155
+
156
+ return { response: text(body, { headers }), body };
98
157
  }
99
158
 
100
159
  /**
@@ -105,17 +164,17 @@ export function create_server_routing_response(route, params, url, manifest) {
105
164
  *
106
165
  * @param {import('types').SSRClientRoute} route
107
166
  * @param {URL} url
108
- * @param {import('@sveltejs/kit').SSRManifest} manifest
167
+ * @param {NonNullable<SSRManifest['_']['client']>} client
109
168
  * @returns {string}
110
169
  */
111
- function create_css_import(route, url, manifest) {
170
+ function create_css_import(route, url, client) {
112
171
  const { errors, layouts, leaf } = route;
113
172
 
114
173
  let css = '';
115
174
 
116
175
  for (const node of [...errors, ...layouts.map((l) => l?.[1]), leaf[1]]) {
117
176
  if (typeof node !== 'number') continue;
118
- const node_css = manifest._.client.css?.[node];
177
+ const node_css = client.css?.[node];
119
178
  for (const css_path of node_css ?? []) {
120
179
  css += `'${assets || base}/${css_path}',`;
121
180
  }
@@ -123,5 +182,5 @@ function create_css_import(route, url, manifest) {
123
182
 
124
183
  if (!css) return '';
125
184
 
126
- return `${create_client_import(/** @type {string} */ (manifest._.client.start), url)}.then(x => x.load_css([${css}]));`;
185
+ return `${create_client_import(client.start, url)}.then(x => x.load_css([${css}]));\n`;
127
186
  }