@sveltejs/kit 1.27.3 → 1.27.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/kit",
3
- "version": "1.27.3",
3
+ "version": "1.27.5",
4
4
  "description": "The fastest way to build Svelte apps",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,7 +11,7 @@
11
11
  "homepage": "https://kit.svelte.dev",
12
12
  "type": "module",
13
13
  "dependencies": {
14
- "@sveltejs/vite-plugin-svelte": "^2.4.1",
14
+ "@sveltejs/vite-plugin-svelte": "^2.5.0",
15
15
  "@types/cookie": "^0.5.1",
16
16
  "cookie": "^0.5.0",
17
17
  "devalue": "^4.3.1",
@@ -41,7 +41,7 @@
41
41
  "vitest": "^0.34.5"
42
42
  },
43
43
  "peerDependencies": {
44
- "svelte": "^3.54.0 || ^4.0.0-next.0",
44
+ "svelte": "^3.54.0 || ^4.0.0-next.0 || ^5.0.0-next.0",
45
45
  "vite": "^4.0.0"
46
46
  },
47
47
  "bin": {
@@ -1,6 +1,6 @@
1
1
  import { join } from 'node:path';
2
2
 
3
- /** @typedef {import('./types').Validator} Validator */
3
+ /** @typedef {import('./types.js').Validator} Validator */
4
4
 
5
5
  const directives = object({
6
6
  'child-src': string_array(),
@@ -444,7 +444,7 @@ function create_routes_and_nodes(cwd, config, fallback) {
444
444
  * @param {string} file
445
445
  * @param {string[]} component_extensions
446
446
  * @param {string[]} module_extensions
447
- * @returns {import('./types').RouteFile}
447
+ * @returns {import('./types.js').RouteFile}
448
448
  */
449
449
  function analyze(project_relative, file, component_extensions, module_extensions) {
450
450
  const component_extension = component_extensions.find((ext) => file.endsWith(ext));
@@ -1,5 +1,6 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
+ import { VERSION } from 'svelte/compiler';
3
4
  import { mkdirp } from '../../utils/filesystem.js';
4
5
 
5
6
  /** @type {Map<string, string>} */
@@ -68,3 +69,7 @@ export function dedent(strings, ...values) {
68
69
 
69
70
  return str;
70
71
  }
72
+
73
+ export function isSvelte5Plus() {
74
+ return Number(VERSION[0]) >= 5;
75
+ }
@@ -1,7 +1,7 @@
1
1
  import path from 'node:path';
2
2
  import { relative_path, resolve_entry } from '../../utils/filesystem.js';
3
3
  import { s } from '../../utils/misc.js';
4
- import { dedent, write_if_changed } from './utils.js';
4
+ import { dedent, isSvelte5Plus, write_if_changed } from './utils.js';
5
5
  import colors from 'kleur';
6
6
 
7
7
  /**
@@ -143,7 +143,7 @@ export function write_client_manifest(kit, manifest_data, output, metadata) {
143
143
  }(({ error }) => { console.error(error) }),
144
144
  };
145
145
 
146
- export { default as root } from '../root.svelte';
146
+ export { default as root } from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}';
147
147
  `
148
148
  );
149
149
 
@@ -1,4 +1,4 @@
1
- import { dedent, write_if_changed } from './utils.js';
1
+ import { dedent, isSvelte5Plus, write_if_changed } from './utils.js';
2
2
 
3
3
  /**
4
4
  * @param {import('types').ManifestData} manifest_data
@@ -89,4 +89,15 @@ export function write_root(manifest_data, output) {
89
89
  {/if}
90
90
  `
91
91
  );
92
+
93
+ if (isSvelte5Plus()) {
94
+ write_if_changed(
95
+ `${output}/root.js`,
96
+ dedent`
97
+ import { asClassComponent } from 'svelte/legacy';
98
+ import Root from './root.svelte';
99
+ export default asClassComponent(Root);
100
+ `
101
+ );
102
+ }
92
103
  }
@@ -4,7 +4,7 @@ import { posixify, resolve_entry } from '../../utils/filesystem.js';
4
4
  import { s } from '../../utils/misc.js';
5
5
  import { load_error_page, load_template } from '../config/index.js';
6
6
  import { runtime_directory } from '../utils.js';
7
- import { write_if_changed } from './utils.js';
7
+ import { isSvelte5Plus, write_if_changed } from './utils.js';
8
8
  import colors from 'kleur';
9
9
 
10
10
  /**
@@ -25,7 +25,7 @@ const server_template = ({
25
25
  template,
26
26
  error_page
27
27
  }) => `
28
- import root from '../root.svelte';
28
+ import root from '../root.${isSvelte5Plus() ? 'js' : 'svelte'}';
29
29
  import { set_building } from '__sveltekit/environment';
30
30
  import { set_assets } from '__sveltekit/paths';
31
31
  import { set_private_env, set_public_env } from '${runtime_directory}/shared-server.js';
@@ -88,6 +88,7 @@ export function get_tsconfig(kit, include_base_url) {
88
88
  const include = new Set([
89
89
  'ambient.d.ts',
90
90
  './types/**/$types.d.ts',
91
+ config_relative('vite.config.js'),
91
92
  config_relative('vite.config.ts')
92
93
  ]);
93
94
  // TODO(v2): find a better way to include all src files. We can't just use routes/lib only because
@@ -10,7 +10,7 @@ import { normalizePath } from 'vite';
10
10
  * @param {import('types').ManifestData} manifest_data
11
11
  * @param {import('vite').Manifest} server_manifest
12
12
  * @param {import('vite').Manifest | null} client_manifest
13
- * @param {import('rollup').OutputAsset[] | null} css
13
+ * @param {import('vite').Rollup.OutputAsset[] | null} css
14
14
  */
15
15
  export function build_server_nodes(out, kit, manifest_data, server_manifest, client_manifest, css) {
16
16
  mkdirp(`${out}/server/nodes`);
@@ -25,7 +25,7 @@ export function is_illegal(id, dirs) {
25
25
 
26
26
  /**
27
27
  * Creates a guard that checks that no id imports a module that is not allowed to be imported into client-side code.
28
- * @param {import('rollup').PluginContext} context
28
+ * @param {import('vite').Rollup.PluginContext} context
29
29
  * @param {{ cwd: string; lib: string }} paths
30
30
  */
31
31
  export function module_guard(context, { cwd, lib }) {
@@ -24,13 +24,13 @@ import prerender from '../../core/postbuild/prerender.js';
24
24
  import analyse from '../../core/postbuild/analyse.js';
25
25
  import { s } from '../../utils/misc.js';
26
26
  import { hash } from '../../runtime/hash.js';
27
- import { dedent } from '../../core/sync/utils.js';
27
+ import { dedent, isSvelte5Plus } from '../../core/sync/utils.js';
28
28
 
29
29
  export { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
30
30
 
31
31
  const cwd = process.cwd();
32
32
 
33
- /** @type {import('./types').EnforcedConfig} */
33
+ /** @type {import('./types.js').EnforcedConfig} */
34
34
  const enforced_config = {
35
35
  appType: true,
36
36
  base: true,
@@ -136,7 +136,7 @@ export async function sveltekit() {
136
136
  onwarn: svelte_config.onwarn,
137
137
  compilerOptions: {
138
138
  // @ts-expect-error SvelteKit requires hydratable true by default
139
- hydratable: true,
139
+ hydratable: isSvelte5Plus() ? undefined : true,
140
140
  ...svelte_config.compilerOptions
141
141
  },
142
142
  ...svelte_config.vitePlugin
@@ -702,7 +702,7 @@ function kit({ svelte_config }) {
702
702
 
703
703
  secondary_build_started = true;
704
704
 
705
- const { output } = /** @type {import('rollup').RollupOutput} */ (
705
+ const { output } = /** @type {import('vite').Rollup.RollupOutput} */ (
706
706
  await vite.build({
707
707
  configFile: vite_config.configFile,
708
708
  // CLI args
@@ -742,7 +742,7 @@ function kit({ svelte_config }) {
742
742
  };
743
743
 
744
744
  const css = output.filter(
745
- /** @type {(value: any) => value is import('rollup').OutputAsset} */
745
+ /** @type {(value: any) => value is import('vite').Rollup.OutputAsset} */
746
746
  (value) => value.type === 'asset' && value.fileName.endsWith('.css')
747
747
  );
748
748
 
@@ -863,7 +863,7 @@ function warn_overridden_config(config, resolved_config) {
863
863
  /**
864
864
  * @param {Record<string, any>} config
865
865
  * @param {Record<string, any>} resolved_config
866
- * @param {import('./types').EnforcedConfig} enforced_config
866
+ * @param {import('./types.js').EnforcedConfig} enforced_config
867
867
  * @param {string} path
868
868
  * @param {string[]} out used locally to compute the return value
869
869
  */
@@ -15,10 +15,7 @@ import { not_found } from '../utils.js';
15
15
  /** @typedef {(req: Req, res: Res, next: () => void) => void} Handler */
16
16
 
17
17
  /**
18
- * @param {{
19
- * middlewares: import('connect').Server;
20
- * httpServer: import('http').Server;
21
- * }} vite
18
+ * @param {{ middlewares: import('connect').Server }} vite
22
19
  * @param {import('vite').ResolvedConfig} vite_config
23
20
  * @param {import('types').ValidatedConfig} svelte_config
24
21
  */
@@ -22,7 +22,8 @@ import {
22
22
  get_link_info,
23
23
  get_router_options,
24
24
  is_external_url,
25
- scroll_state
25
+ scroll_state,
26
+ origin
26
27
  } from './utils.js';
27
28
 
28
29
  import { base } from '__sveltekit/paths';
@@ -55,9 +56,9 @@ function update_scroll_positions(index) {
55
56
  }
56
57
 
57
58
  /**
58
- * @param {import('./types').SvelteKitApp} app
59
+ * @param {import('./types.js').SvelteKitApp} app
59
60
  * @param {HTMLElement} target
60
- * @returns {import('./types').Client}
61
+ * @returns {import('./types.js').Client}
61
62
  */
62
63
  export function create_client(app, target) {
63
64
  const routes = parse(app);
@@ -82,7 +83,7 @@ export function create_client(app, target) {
82
83
  */
83
84
  const components = [];
84
85
 
85
- /** @type {{id: string, promise: Promise<import('./types').NavigationResult>} | null} */
86
+ /** @type {{id: string, promise: Promise<import('./types.js').NavigationResult>} | null} */
86
87
  let load_cache = null;
87
88
 
88
89
  const callbacks = {
@@ -96,7 +97,7 @@ export function create_client(app, target) {
96
97
  after_navigate: []
97
98
  };
98
99
 
99
- /** @type {import('./types').NavigationState} */
100
+ /** @type {import('./types.js').NavigationState} */
100
101
  let current = {
101
102
  branch: [],
102
103
  error: null,
@@ -247,7 +248,7 @@ export function create_client(app, target) {
247
248
  });
248
249
  }
249
250
 
250
- /** @param {import('./types').NavigationIntent} intent */
251
+ /** @param {import('./types.js').NavigationIntent} intent */
251
252
  async function preload_data(intent) {
252
253
  load_cache = {
253
254
  id: intent.id,
@@ -274,7 +275,7 @@ export function create_client(app, target) {
274
275
  await Promise.all(promises);
275
276
  }
276
277
 
277
- /** @param {import('./types').NavigationFinished} result */
278
+ /** @param {import('./types.js').NavigationFinished} result */
278
279
  function initialize(result) {
279
280
  if (DEV && result.state.error && document.querySelector('vite-error-overlay')) return;
280
281
 
@@ -315,7 +316,7 @@ export function create_client(app, target) {
315
316
  * @param {{
316
317
  * url: URL;
317
318
  * params: Record<string, string>;
318
- * branch: Array<import('./types').BranchNode | undefined>;
319
+ * branch: Array<import('./types.js').BranchNode | undefined>;
319
320
  * status: number;
320
321
  * error: App.Error | null;
321
322
  * route: import('types').CSRRoute | null;
@@ -340,7 +341,7 @@ export function create_client(app, target) {
340
341
  // eslint-disable-next-line
341
342
  url.search = url.search; // turn `/?` into `/`
342
343
 
343
- /** @type {import('./types').NavigationFinished} */
344
+ /** @type {import('./types.js').NavigationFinished} */
344
345
  const result = {
345
346
  type: 'loaded',
346
347
  state: {
@@ -417,9 +418,9 @@ export function create_client(app, target) {
417
418
  * url: URL;
418
419
  * params: Record<string, string>;
419
420
  * route: { id: string | null };
420
- * server_data_node: import('./types').DataNode | null;
421
+ * server_data_node: import('./types.js').DataNode | null;
421
422
  * }} options
422
- * @returns {Promise<import('./types').BranchNode>}
423
+ * @returns {Promise<import('./types.js').BranchNode>}
423
424
  */
424
425
  async function load_node({ loader, parent, url, params, route, server_data_node }) {
425
426
  /** @type {Record<string, any> | null} */
@@ -589,8 +590,8 @@ export function create_client(app, target) {
589
590
 
590
591
  /**
591
592
  * @param {import('types').ServerDataNode | import('types').ServerDataSkippedNode | null} node
592
- * @param {import('./types').DataNode | null} [previous]
593
- * @returns {import('./types').DataNode | null}
593
+ * @param {import('./types.js').DataNode | null} [previous]
594
+ * @returns {import('./types.js').DataNode | null}
594
595
  */
595
596
  function create_data_node(node, previous) {
596
597
  if (node?.type === 'data') return node;
@@ -599,8 +600,8 @@ export function create_client(app, target) {
599
600
  }
600
601
 
601
602
  /**
602
- * @param {import('./types').NavigationIntent} intent
603
- * @returns {Promise<import('./types').NavigationResult>}
603
+ * @param {import('./types.js').NavigationIntent} intent
604
+ * @returns {Promise<import('./types.js').NavigationResult>}
604
605
  */
605
606
  async function load_route({ id, invalidating, url, params, route }) {
606
607
  if (load_cache?.id === id) {
@@ -664,7 +665,7 @@ export function create_client(app, target) {
664
665
  const branch_promises = loaders.map(async (loader, i) => {
665
666
  if (!loader) return;
666
667
 
667
- /** @type {import('./types').BranchNode | undefined} */
668
+ /** @type {import('./types.js').BranchNode | undefined} */
668
669
  const previous = current.branch[i];
669
670
 
670
671
  const server_data_node = server_data_nodes?.[i];
@@ -707,7 +708,7 @@ export function create_client(app, target) {
707
708
  // if we don't do this, rejections will be unhandled
708
709
  for (const p of branch_promises) p.catch(() => {});
709
710
 
710
- /** @type {Array<import('./types').BranchNode | undefined>} */
711
+ /** @type {Array<import('./types.js').BranchNode | undefined>} */
711
712
  const branch = [];
712
713
 
713
714
  for (let i = 0; i < loaders.length; i += 1) {
@@ -781,9 +782,9 @@ export function create_client(app, target) {
781
782
 
782
783
  /**
783
784
  * @param {number} i Start index to backtrack from
784
- * @param {Array<import('./types').BranchNode | undefined>} branch Branch to backtrack
785
+ * @param {Array<import('./types.js').BranchNode | undefined>} branch Branch to backtrack
785
786
  * @param {Array<import('types').CSRPageNodeLoader | undefined>} errors All error pages for this branch
786
- * @returns {Promise<{idx: number; node: import('./types').BranchNode} | undefined>}
787
+ * @returns {Promise<{idx: number; node: import('./types.js').BranchNode} | undefined>}
787
788
  */
788
789
  async function load_nearest_error_page(i, branch, errors) {
789
790
  while (i--) {
@@ -815,7 +816,7 @@ export function create_client(app, target) {
815
816
  * url: URL;
816
817
  * route: { id: string | null }
817
818
  * }} opts
818
- * @returns {Promise<import('./types').NavigationFinished>}
819
+ * @returns {Promise<import('./types.js').NavigationFinished>}
819
820
  */
820
821
  async function load_root_error_page({ status, error, url, route }) {
821
822
  /** @type {Record<string, string>} */
@@ -843,7 +844,7 @@ export function create_client(app, target) {
843
844
  } catch {
844
845
  // at this point we have no choice but to fall back to the server, if it wouldn't
845
846
  // bring us right back here, turning this into an endless loop
846
- if (url.origin !== location.origin || url.pathname !== location.pathname || hydrated) {
847
+ if (url.origin !== origin || url.pathname !== location.pathname || hydrated) {
847
848
  await native_navigation(url);
848
849
  }
849
850
  }
@@ -858,7 +859,7 @@ export function create_client(app, target) {
858
859
  server_data_node: create_data_node(server_data_node)
859
860
  });
860
861
 
861
- /** @type {import('./types').BranchNode} */
862
+ /** @type {import('./types.js').BranchNode} */
862
863
  const root_error = {
863
864
  node: await default_error_loader(),
864
865
  loader: default_error_loader,
@@ -891,7 +892,7 @@ export function create_client(app, target) {
891
892
 
892
893
  if (params) {
893
894
  const id = url.pathname + url.search;
894
- /** @type {import('./types').NavigationIntent} */
895
+ /** @type {import('./types.js').NavigationIntent} */
895
896
  const intent = { id, invalidating, route, params: decode_params(params), url };
896
897
  return intent;
897
898
  }
@@ -907,7 +908,7 @@ export function create_client(app, target) {
907
908
  * @param {{
908
909
  * url: URL;
909
910
  * type: import('@sveltejs/kit').Navigation["type"];
910
- * intent?: import('./types').NavigationIntent;
911
+ * intent?: import('./types.js').NavigationIntent;
911
912
  * delta?: number;
912
913
  * }} opts
913
914
  */
@@ -1170,10 +1171,10 @@ export function create_client(app, target) {
1170
1171
  * @param {{ id: string | null }} route
1171
1172
  * @param {App.Error} error
1172
1173
  * @param {number} status
1173
- * @returns {Promise<import('./types').NavigationFinished>}
1174
+ * @returns {Promise<import('./types.js').NavigationFinished>}
1174
1175
  */
1175
1176
  async function server_fallback(url, route, error, status) {
1176
- if (url.origin === location.origin && url.pathname === location.pathname && !hydrated) {
1177
+ if (url.origin === origin && url.pathname === location.pathname && !hydrated) {
1177
1178
  // We would reload the same page we're currently on, which isn't hydrated,
1178
1179
  // which means no SSR, which means we would end up in an endless loop
1179
1180
  return await load_root_error_page({
@@ -1765,7 +1766,7 @@ export function create_client(app, target) {
1765
1766
  ({ params = {}, route = { id: null } } = get_navigation_intent(url, false) || {});
1766
1767
  }
1767
1768
 
1768
- /** @type {import('./types').NavigationFinished | undefined} */
1769
+ /** @type {import('./types.js').NavigationFinished | undefined} */
1769
1770
  let result;
1770
1771
 
1771
1772
  try {
@@ -1792,7 +1793,7 @@ export function create_client(app, target) {
1792
1793
  });
1793
1794
  });
1794
1795
 
1795
- /** @type {Array<import('./types').BranchNode | undefined>} */
1796
+ /** @type {Array<import('./types.js').BranchNode | undefined>} */
1796
1797
  const branch = await Promise.all(branch_promises);
1797
1798
 
1798
1799
  const parsed_route = routes.find(({ id }) => id === route.id);
@@ -2018,8 +2019,8 @@ function reset_focus() {
2018
2019
  }
2019
2020
 
2020
2021
  /**
2021
- * @param {import('./types').NavigationState} current
2022
- * @param {import('./types').NavigationIntent | undefined} intent
2022
+ * @param {import('./types.js').NavigationState} current
2023
+ * @param {import('./types.js').NavigationIntent | undefined} intent
2023
2024
  * @param {URL | null} url
2024
2025
  * @param {Exclude<import('@sveltejs/kit').NavigationType, 'enter'>} type
2025
2026
  */
@@ -1,7 +1,7 @@
1
1
  import { exec, parse_route_id } from '../../utils/routing.js';
2
2
 
3
3
  /**
4
- * @param {import('./types').SvelteKitApp} app
4
+ * @param {import('./types.js').SvelteKitApp} app
5
5
  * @returns {import('types').CSRRoute[]}
6
6
  */
7
7
  export function parse({ nodes, server_loads, dictionary, matchers }) {
@@ -2,12 +2,12 @@ import { writable } from 'svelte/store';
2
2
  import { create_updated_store, notifiable_store } from './utils.js';
3
3
  import { BROWSER } from 'esm-env';
4
4
 
5
- /** @type {import('./types').Client} */
5
+ /** @type {import('./types.js').Client} */
6
6
  export let client;
7
7
 
8
8
  /**
9
9
  * @param {{
10
- * client: import('./types').Client;
10
+ * client: import('./types.js').Client;
11
11
  * }} opts
12
12
  */
13
13
  export function init(opts) {
@@ -3,9 +3,9 @@ import { create_client } from './client.js';
3
3
  import { init } from './singletons.js';
4
4
 
5
5
  /**
6
- * @param {import('./types').SvelteKitApp} app
6
+ * @param {import('./types.js').SvelteKitApp} app
7
7
  * @param {HTMLElement} target
8
- * @param {Parameters<import('./types').Client['_hydrate']>[0]} [hydrate]
8
+ * @param {Parameters<import('./types.js').Client['_hydrate']>[0]} [hydrate]
9
9
  */
10
10
  export async function start(app, target, hydrate) {
11
11
  if (DEV && target === document.body) {
@@ -1,4 +1,4 @@
1
- import { applyAction } from '../app/forms';
1
+ import { applyAction } from '../app/forms.js';
2
2
  import {
3
3
  afterNavigate,
4
4
  beforeNavigate,
@@ -8,7 +8,7 @@ import {
8
8
  invalidateAll,
9
9
  preloadCode,
10
10
  preloadData
11
- } from '../app/navigation';
11
+ } from '../app/navigation.js';
12
12
  import { SvelteComponent } from 'svelte';
13
13
  import { ClientHooks, CSRPageNode, CSRPageNodeLoader, CSRRoute, TrailingSlash, Uses } from 'types';
14
14
  import { Page, ParamMatcher } from '@sveltejs/kit';
@@ -90,7 +90,8 @@ export type NavigationFinished = {
90
90
  type: 'loaded';
91
91
  state: NavigationState;
92
92
  props: {
93
- components: Array<typeof SvelteComponent>;
93
+ constructors: Array<typeof SvelteComponent>;
94
+ components?: Array<SvelteComponent>;
94
95
  page?: Page;
95
96
  form?: Record<string, any> | null;
96
97
  [key: `data_${number}`]: Record<string, any>;
@@ -6,6 +6,8 @@ import { PRELOAD_PRIORITIES } from './constants.js';
6
6
 
7
7
  /* global __SVELTEKIT_APP_VERSION_FILE__, __SVELTEKIT_APP_VERSION_POLL_INTERVAL__ */
8
8
 
9
+ export const origin = BROWSER ? location.origin : '';
10
+
9
11
  /** @param {HTMLDocument} doc */
10
12
  export function get_base_uri(doc) {
11
13
  let baseURI = doc.baseURI;
@@ -135,7 +137,7 @@ export function get_link_info(a, base) {
135
137
  is_external_url(url, base) ||
136
138
  (a.getAttribute('rel') || '').split(/\s+/).includes('external');
137
139
 
138
- const download = url?.origin === location.origin && a.hasAttribute('download');
140
+ const download = url?.origin === origin && a.hasAttribute('download');
139
141
 
140
142
  return { url, external, target, download };
141
143
  }
@@ -290,5 +292,5 @@ export function create_updated_store() {
290
292
  * @param {string} base
291
293
  */
292
294
  export function is_external_url(url, base) {
293
- return url.origin !== location.origin || !url.pathname.startsWith(base);
295
+ return url.origin !== origin || !url.pathname.startsWith(base);
294
296
  }
@@ -27,7 +27,7 @@ export function get_cookies(request, url, trailing_slash) {
27
27
  // Emulate browser-behavior: if the cookie is set at '/foo/bar', its path is '/foo'
28
28
  const default_path = normalized_url.split('/').slice(0, -1).join('/') || '/';
29
29
 
30
- /** @type {Record<string, import('./page/types').Cookie>} */
30
+ /** @type {Record<string, import('./page/types.js').Cookie>} */
31
31
  const new_cookies = {};
32
32
 
33
33
  /** @type {import('cookie').CookieSerializeOptions} */
@@ -232,7 +232,7 @@ export function path_matches(path, constraint) {
232
232
 
233
233
  /**
234
234
  * @param {Headers} headers
235
- * @param {import('./page/types').Cookie[]} cookies
235
+ * @param {import('./page/types.js').Cookie[]} cookies
236
236
  */
237
237
  export function add_cookies_to_headers(headers, cookies) {
238
238
  for (const new_cookie of cookies) {
@@ -223,8 +223,8 @@ export class Csp {
223
223
  report_only_provider;
224
224
 
225
225
  /**
226
- * @param {import('./types').CspConfig} config
227
- * @param {import('./types').CspOpts} opts
226
+ * @param {import('./types.js').CspConfig} config
227
+ * @param {import('./types.js').CspOpts} opts
228
228
  */
229
229
  constructor({ mode, directives, reportOnly }, { prerender }) {
230
230
  const use_hashes = mode === 'hash' || (mode === 'auto' && prerender);
@@ -96,10 +96,10 @@ export async function render_page(event, page, options, manifest, state, resolve
96
96
  // inherit the prerender option of the page
97
97
  state.prerender_default = should_prerender;
98
98
 
99
- /** @type {import('./types').Fetched[]} */
99
+ /** @type {import('./types.js').Fetched[]} */
100
100
  const fetched = [];
101
101
 
102
- if (get_option(nodes, 'ssr') === false) {
102
+ if (get_option(nodes, 'ssr') === false && !state.prerendering) {
103
103
  return await render_response({
104
104
  branch: [],
105
105
  fetched,
@@ -144,7 +144,7 @@ export async function load_server_data({
144
144
  * Calls the user's `load` function.
145
145
  * @param {{
146
146
  * event: import('@sveltejs/kit').RequestEvent;
147
- * fetched: import('./types').Fetched[];
147
+ * fetched: import('./types.js').Fetched[];
148
148
  * node: import('types').SSRNode | undefined;
149
149
  * parent: () => Promise<Record<string, any>>;
150
150
  * resolve_opts: import('types').RequiredResolveOptions;
@@ -192,7 +192,7 @@ export async function load_data({
192
192
  /**
193
193
  * @param {Pick<import('@sveltejs/kit').RequestEvent, 'fetch' | 'url' | 'request' | 'route'>} event
194
194
  * @param {import('types').SSRState} state
195
- * @param {import('./types').Fetched[]} fetched
195
+ * @param {import('./types.js').Fetched[]} fetched
196
196
  * @param {boolean} csr
197
197
  * @param {Pick<Required<import('@sveltejs/kit').ResolveOptions>, 'filterSerializedResponseHeaders'>} resolve_opts
198
198
  */
@@ -26,8 +26,8 @@ const encoder = new TextEncoder();
26
26
  /**
27
27
  * Creates the HTML response.
28
28
  * @param {{
29
- * branch: Array<import('./types').Loaded>;
30
- * fetched: Array<import('./types').Fetched>;
29
+ * branch: Array<import('./types.js').Loaded>;
30
+ * fetched: Array<import('./types.js').Fetched>;
31
31
  * options: import('types').SSROptions;
32
32
  * manifest: import('@sveltejs/kit').SSRManifest;
33
33
  * state: import('types').SSRState;
@@ -33,7 +33,7 @@ export async function respond_with_error({
33
33
  return static_error_page(options, status, /** @type {Error} */ (error).message);
34
34
  }
35
35
 
36
- /** @type {import('./types').Fetched[]} */
36
+ /** @type {import('./types.js').Fetched[]} */
37
37
  const fetched = [];
38
38
 
39
39
  try {
@@ -134,7 +134,7 @@ export async function respond(request, options, manifest, state) {
134
134
  /** @type {Record<string, string>} */
135
135
  const headers = {};
136
136
 
137
- /** @type {Record<string, import('./page/types').Cookie>} */
137
+ /** @type {Record<string, import('./page/types.js').Cookie>} */
138
138
  let cookies_to_add = {};
139
139
 
140
140
  /** @type {import('@sveltejs/kit').RequestEvent} */
@@ -414,5 +414,5 @@ export type ValidatedConfig = RecursiveRequired<Config>;
414
414
 
415
415
  export type ValidatedKitConfig = RecursiveRequired<KitConfig>;
416
416
 
417
- export * from '../exports/index';
417
+ export * from '../exports/index.js';
418
418
  export * from './private.js';
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // generated during release, do not modify
2
2
 
3
3
  /** @type {string} */
4
- export const VERSION = '1.27.3';
4
+ export const VERSION = '1.27.5';