@sveltejs/kit 3.0.0-next.24 → 3.0.0-next.25
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 +12 -4
- package/src/constants.js +6 -0
- package/src/core/adapt/builder.js +1 -2
- package/src/core/env.js +3 -6
- package/src/core/postbuild/prerender.js +2 -2
- package/src/core/sync/write_server.js +3 -17
- package/src/core/utils.js +10 -0
- package/src/exports/adapter.js +22 -0
- package/src/exports/public.d.ts +1 -1
- package/src/exports/vite/build/service-worker.js +98 -0
- package/src/exports/vite/dev/index.js +17 -3
- package/src/exports/vite/index.js +41 -411
- package/src/exports/vite/plugins/env-vars.js +42 -0
- package/src/exports/vite/plugins/guard.js +205 -0
- package/src/exports/vite/utils.js +97 -0
- package/src/runtime/app/server/remote/query.js +2 -2
- package/src/runtime/client/client.js +4 -4
- package/src/runtime/form-utils.js +11 -19
- package/src/runtime/server/data/index.js +11 -26
- package/src/runtime/server/errors.js +7 -10
- package/src/runtime/server/fetch.js +14 -16
- package/src/runtime/server/index.js +28 -25
- package/src/runtime/server/internal.js +34 -4
- package/src/runtime/server/page/actions.js +6 -8
- package/src/runtime/server/page/data_serializer.js +6 -10
- package/src/runtime/server/page/index.js +9 -14
- package/src/runtime/server/page/render.js +16 -29
- package/src/runtime/server/page/respond_with_error.js +7 -9
- package/src/runtime/server/remote-functions.js +125 -125
- package/src/runtime/server/respond.js +53 -28
- package/src/runtime/server/state.js +1 -0
- package/src/runtime/server/utils.js +0 -7
- package/src/runtime/utils.js +41 -0
- package/src/types/global-private.d.ts +8 -0
- package/src/types/internal.d.ts +7 -11
- package/src/utils/filesystem.js +1 -1
- package/src/utils/streaming.js +5 -15
- package/src/version.js +1 -1
- package/types/index.d.ts +20 -1
- package/types/index.d.ts.map +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltejs/kit",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.25",
|
|
4
4
|
"description": "SvelteKit is the fastest way to build Svelte apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -148,6 +148,10 @@
|
|
|
148
148
|
"types": "./types/index.d.ts",
|
|
149
149
|
"import": "./src/exports/internal/server/index.js"
|
|
150
150
|
},
|
|
151
|
+
"./adapter": {
|
|
152
|
+
"types": "./types/index.d.ts",
|
|
153
|
+
"import": "./src/exports/adapter.js"
|
|
154
|
+
},
|
|
151
155
|
"./node": {
|
|
152
156
|
"types": "./types/index.d.ts",
|
|
153
157
|
"import": "./src/exports/node/index.js"
|
|
@@ -180,9 +184,13 @@
|
|
|
180
184
|
"format": "oxfmt --write .",
|
|
181
185
|
"test": "pnpm test:unit && pnpm test:integration",
|
|
182
186
|
"test:integration": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test",
|
|
183
|
-
"test:dev": "pnpm -r --workspace-concurrency
|
|
184
|
-
"test:build": "pnpm -r --workspace-concurrency
|
|
185
|
-
"test:
|
|
187
|
+
"test:dev": "pnpm -r --workspace-concurrency 2 --filter=\"./test/**\" test:dev",
|
|
188
|
+
"test:build": "pnpm -r --workspace-concurrency 2 --filter=\"./test/**\" test:build",
|
|
189
|
+
"test:dev:basics": "pnpm --filter=test-basics test:dev",
|
|
190
|
+
"test:dev:rest": "pnpm -r --workspace-concurrency 2 --filter=\"./test/**\" --filter=\"!test-basics\" test:dev",
|
|
191
|
+
"test:build:basics": "pnpm --filter=test-basics test:build",
|
|
192
|
+
"test:build:rest": "pnpm -r --workspace-concurrency 2 --filter=\"./test/**\" --filter=\"!test-basics\" test:build",
|
|
193
|
+
"test:cross-platform:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:dev",
|
|
186
194
|
"test:cross-platform:build": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:cross-platform:build",
|
|
187
195
|
"test:server-side-route-resolution:dev": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:server-side-route-resolution:dev",
|
|
188
196
|
"test:server-side-route-resolution:build": "pnpm -r --workspace-concurrency 1 --filter=\"./test/**\" test:server-side-route-resolution:build",
|
package/src/constants.js
CHANGED
|
@@ -28,3 +28,9 @@ export const SRC_ROOT = import.meta.dirname;
|
|
|
28
28
|
|
|
29
29
|
// eslint-disable-next-line n/prefer-global/process
|
|
30
30
|
export const IN_WEBCONTAINER = !!globalThis.process?.versions?.webcontainer;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* If an an adapter deploys a catch-all serverless function, the rerouted URL
|
|
34
|
+
* is stored in this header.
|
|
35
|
+
*/
|
|
36
|
+
export const REROUTED_URL_HEADER = 'x-sveltekit-rerouted-url';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/** @import { StandardSchemaV1 } from '@standard-schema/spec' */
|
|
2
|
-
/** @import { Builder } from '@sveltejs/kit' */
|
|
3
2
|
/** @import { ResolvedConfig } from 'vite' */
|
|
4
|
-
/** @import { RouteDefinition } from '@sveltejs/kit' */
|
|
3
|
+
/** @import { Builder, RouteDefinition } from '@sveltejs/kit' */
|
|
5
4
|
/** @import { EnvVarConfig } from '@sveltejs/kit/env' */
|
|
6
5
|
/** @import { RouteData, ValidatedConfig, BuildData, ServerMetadata, ServerMetadataRoute, Prerendered, PrerenderMap, Logger, RemoteChunk } from 'types' */
|
|
7
6
|
import { loadEnv } from 'vite';
|
package/src/core/env.js
CHANGED
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import * as devalue from 'devalue';
|
|
6
6
|
import { dedent } from './sync/utils.js';
|
|
7
|
-
import { runtime_directory } from './utils.js';
|
|
7
|
+
import { get_global_name, runtime_directory } from './utils.js';
|
|
8
8
|
import { resolve_entry } from '../utils/filesystem.js';
|
|
9
9
|
import { handle_issues, validate } from '../exports/internal/env.js';
|
|
10
10
|
import { get_config_aliases } from '../exports/vite/utils.js';
|
|
11
11
|
import { get_runner } from '../runner.js';
|
|
12
12
|
import { import_peer } from '../utils/import.js';
|
|
13
|
-
import { hash } from '../utils/hash.js';
|
|
14
13
|
import { posixify } from '../utils/os.js';
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -216,9 +215,7 @@ export function create_env_modules(config, variables, env, dir, entry, is_dev) {
|
|
|
216
215
|
*/
|
|
217
216
|
const module = (prelude, exports) => (variables ? `${prelude}\n\n${exports.join('')}` : '');
|
|
218
217
|
|
|
219
|
-
const global = is_dev
|
|
220
|
-
? 'globalThis.__sveltekit_dev'
|
|
221
|
-
: `globalThis.__sveltekit_${hash(config.version.name)}`;
|
|
218
|
+
const global = `globalThis.${get_global_name(config.version.name, is_dev)}`;
|
|
222
219
|
|
|
223
220
|
const version = JSON.stringify(config.version.name);
|
|
224
221
|
|
|
@@ -257,7 +254,7 @@ export function create_env_modules(config, variables, env, dir, entry, is_dev) {
|
|
|
257
254
|
),
|
|
258
255
|
'public/client.js': module(
|
|
259
256
|
is_dev
|
|
260
|
-
? `const { env } =
|
|
257
|
+
? `const { env } = ${global};`
|
|
261
258
|
: `import { payload } from ${JSON.stringify(posixify(path.relative(`${dir}/public`, `${runtime_directory}/client/payload.js`)))};\nconst env = payload.env;`,
|
|
262
259
|
public_exports
|
|
263
260
|
),
|
|
@@ -52,7 +52,7 @@ async function prerender({
|
|
|
52
52
|
const manifest = (await import(pathToFileURL(manifest_path).href)).manifest;
|
|
53
53
|
|
|
54
54
|
/** @type {import('types').ServerInternalModule} */
|
|
55
|
-
const { set_building, set_prerendering, set_manifest, set_read_implementation,
|
|
55
|
+
const { set_building, set_prerendering, set_manifest, set_read_implementation, format_response } =
|
|
56
56
|
await import(pathToFileURL(`${out}/server/internal.js`).href);
|
|
57
57
|
|
|
58
58
|
// configure `import { building } from `$app/env` —
|
|
@@ -424,7 +424,7 @@ async function prerender({
|
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
if (response.status >= 400) {
|
|
427
|
-
|
|
427
|
+
console.log(format_response(response.status, request));
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
const body = Buffer.from(await response.arrayBuffer());
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { hash } from '../../utils/hash.js';
|
|
3
2
|
import { resolve_entry } from '../../utils/filesystem.js';
|
|
4
3
|
import { posixify } from '../../utils/os.js';
|
|
5
4
|
import { s } from '../../utils/misc.js';
|
|
@@ -13,7 +12,6 @@ import { runtime_directory } from '../utils.js';
|
|
|
13
12
|
* server_hooks: string | null;
|
|
14
13
|
* universal_hooks: string | null;
|
|
15
14
|
* config: import('types').ValidatedConfig;
|
|
16
|
-
* has_service_worker: boolean;
|
|
17
15
|
* template: string;
|
|
18
16
|
* runtime_directory: string;
|
|
19
17
|
* }} opts
|
|
@@ -22,26 +20,18 @@ const server_template = ({
|
|
|
22
20
|
config,
|
|
23
21
|
server_hooks,
|
|
24
22
|
universal_hooks,
|
|
25
|
-
has_service_worker,
|
|
26
23
|
template,
|
|
27
24
|
runtime_directory
|
|
28
25
|
}) => `
|
|
29
26
|
import { set_building, set_prerendering } from '$app/env/server';
|
|
30
27
|
import { set_assets } from '$app/paths/internal/server';
|
|
31
|
-
import { set_fix_stack_trace, set_manifest, set_read_implementation,
|
|
28
|
+
import { set_fix_stack_trace, set_manifest, set_read_implementation, format_response } from '${runtime_directory}/server/internal.js';
|
|
32
29
|
import error from './shared/error-template.js';
|
|
33
30
|
|
|
34
31
|
export const options = {
|
|
35
32
|
app_template_contains_nonce: ${template.includes('%sveltekit.nonce%')},
|
|
36
33
|
csp: ${s(config.csp)},
|
|
37
|
-
csrf_check_origin: ${s(!config.csrf.trustedOrigins.includes('*'))},
|
|
38
34
|
csrf_trusted_origins: ${s(config.csrf.trustedOrigins)},
|
|
39
|
-
embedded: ${config.embedded},
|
|
40
|
-
hash_routing: ${s(config.router.type === 'hash')},
|
|
41
|
-
hooks: null, // added lazily, via \`get_hooks\`
|
|
42
|
-
link_header_preload: ${s(config.output.linkHeaderPreload)},
|
|
43
|
-
paths_origin: ${s(config.paths.origin)},
|
|
44
|
-
service_worker: ${has_service_worker},
|
|
45
35
|
service_worker_options: ${config.serviceWorker.register ? s(config.serviceWorker.options) : 'null'},
|
|
46
36
|
templates: {
|
|
47
37
|
app: ({ head, body, assets, nonce, env }) => ${s(template)
|
|
@@ -55,9 +45,7 @@ export const options = {
|
|
|
55
45
|
(_match, capture) => `" + (env[${s(capture)}] ?? "") + "`
|
|
56
46
|
)},
|
|
57
47
|
error
|
|
58
|
-
}
|
|
59
|
-
version: ${s(config.version.name)},
|
|
60
|
-
version_hash: ${s(hash(config.version.name))}
|
|
48
|
+
}
|
|
61
49
|
};
|
|
62
50
|
|
|
63
51
|
export async function get_hooks() {
|
|
@@ -81,7 +69,7 @@ export async function get_hooks() {
|
|
|
81
69
|
};
|
|
82
70
|
}
|
|
83
71
|
|
|
84
|
-
export { set_assets, set_building, set_fix_stack_trace, set_manifest, set_prerendering, set_read_implementation,
|
|
72
|
+
export { set_assets, set_building, set_fix_stack_trace, set_manifest, set_prerendering, set_read_implementation, format_response };
|
|
85
73
|
`;
|
|
86
74
|
|
|
87
75
|
/**
|
|
@@ -125,8 +113,6 @@ export function write_server(config, output, root) {
|
|
|
125
113
|
runtime_directory: relative(runtime_directory),
|
|
126
114
|
server_hooks: server_hooks_file ? relative(server_hooks_file) : null,
|
|
127
115
|
universal_hooks: universal_hooks_file ? relative(universal_hooks_file) : null,
|
|
128
|
-
has_service_worker:
|
|
129
|
-
config.serviceWorker.register && !!resolve_entry(config.files.serviceWorker),
|
|
130
116
|
template: load_template(root, config)
|
|
131
117
|
})
|
|
132
118
|
);
|
package/src/core/utils.js
CHANGED
|
@@ -4,6 +4,7 @@ import { styleText } from 'node:util';
|
|
|
4
4
|
import { to_fs } from '../utils/vite.js';
|
|
5
5
|
import { noop } from '../utils/functions.js';
|
|
6
6
|
import { posixify } from '../utils/os.js';
|
|
7
|
+
import { hash } from '../utils/hash.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Resolved path of the `runtime` directory posix-ified
|
|
@@ -15,6 +16,15 @@ import { posixify } from '../utils/os.js';
|
|
|
15
16
|
*/
|
|
16
17
|
export const runtime_directory = posixify(fileURLToPath(new URL('../runtime', import.meta.url)));
|
|
17
18
|
|
|
19
|
+
/**
|
|
20
|
+
* The name of the `globalThis.__sveltekit_xxx` object the app's payload is attached to
|
|
21
|
+
* @param {string} version_name
|
|
22
|
+
* @param {boolean} dev
|
|
23
|
+
*/
|
|
24
|
+
export function get_global_name(version_name, dev) {
|
|
25
|
+
return dev ? '__sveltekit_dev' : `__sveltekit_${hash(version_name)}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
18
28
|
/**
|
|
19
29
|
* This allows us to import SvelteKit internals that aren't exposed via `pkg.exports` in a
|
|
20
30
|
* way that works whether `@sveltejs/kit` is installed inside the project's `node_modules`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { REROUTED_URL_HEADER } from '../constants.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Helps a catch-all request handler pass the request to a different handler if
|
|
5
|
+
* the `reroute` hook has returned a URL pathname that's different from the
|
|
6
|
+
* incoming request.
|
|
7
|
+
*
|
|
8
|
+
* If your adapter is capable of deploying multiple serverless functions, it's a
|
|
9
|
+
* good idea to also deploy a "catch-all" one to handle uncaught requests.
|
|
10
|
+
* Running this in that function allows the app's `reroute` hook to rewrite
|
|
11
|
+
* the request URL and invoke the next appropriate serverless function, if any.
|
|
12
|
+
* @param {Response} response The response returned from the SvelteKit `server.respond` function
|
|
13
|
+
* @param {(url: URL) => Response | Promise<Response>} next Your platform-specific implementation for invoking the next handler with a different request URL
|
|
14
|
+
* @returns {Response | Promise<Response>}
|
|
15
|
+
* @since 3.0.0
|
|
16
|
+
*/
|
|
17
|
+
export function applyReroute(response, next) {
|
|
18
|
+
const rerouted_url = response.headers.get(REROUTED_URL_HEADER);
|
|
19
|
+
if (!rerouted_url) return response;
|
|
20
|
+
|
|
21
|
+
return next(new URL(rerouted_url));
|
|
22
|
+
}
|
package/src/exports/public.d.ts
CHANGED
|
@@ -165,7 +165,7 @@ export interface Builder {
|
|
|
165
165
|
/**
|
|
166
166
|
* Generate a server-side manifest to initialise the SvelteKit [server](https://svelte.dev/docs/kit/@sveltejs-kit#Server) with.
|
|
167
167
|
* @param opts
|
|
168
|
-
* @param opts.relativePath
|
|
168
|
+
* @param opts.relativePath A relative path to the base directory of the server build output
|
|
169
169
|
*/
|
|
170
170
|
generateManifest: (opts: { relativePath: string; routes?: RouteDefinition[] }) => string;
|
|
171
171
|
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/** @import { ValidatedConfig } from 'types' */
|
|
2
|
+
/** @import { Plugin, UserConfig } from 'vite' */
|
|
3
|
+
import { runtime_directory } from '../../../core/utils.js';
|
|
4
|
+
import { warn_overridden_config } from '../utils.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @param {ValidatedConfig} kit
|
|
8
|
+
* @param {() => { service_worker_entry_file: string | null; kit_global: string; out: string; initial_config: UserConfig; }} get_config
|
|
9
|
+
* @returns {Plugin}
|
|
10
|
+
*/
|
|
11
|
+
export function plugin_service_worker_build(kit, get_config) {
|
|
12
|
+
return {
|
|
13
|
+
name: 'vite-plugin-sveltekit-service-worker',
|
|
14
|
+
|
|
15
|
+
config(config) {
|
|
16
|
+
const { service_worker_entry_file, kit_global, out, initial_config } = get_config();
|
|
17
|
+
|
|
18
|
+
if (!service_worker_entry_file) return;
|
|
19
|
+
|
|
20
|
+
if (kit.paths.assets) {
|
|
21
|
+
throw new Error('Cannot use service worker alongside config.paths.assets');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const user_service_worker_output_config =
|
|
25
|
+
config.environments?.serviceWorker?.build?.rolldownOptions?.output;
|
|
26
|
+
|
|
27
|
+
/** @type {UserConfig} */
|
|
28
|
+
const new_config = {
|
|
29
|
+
environments: {
|
|
30
|
+
serviceWorker: {
|
|
31
|
+
define: {
|
|
32
|
+
__SVELTEKIT_PAYLOAD__: kit_global
|
|
33
|
+
},
|
|
34
|
+
build: {
|
|
35
|
+
modulePreload: false,
|
|
36
|
+
rolldownOptions: {
|
|
37
|
+
external: [`${kit.paths.base}/${kit.appDir}/env.js`],
|
|
38
|
+
input: {
|
|
39
|
+
'service-worker': service_worker_entry_file
|
|
40
|
+
},
|
|
41
|
+
output: {
|
|
42
|
+
format: 'es',
|
|
43
|
+
entryFileNames: 'service-worker.js',
|
|
44
|
+
assetFileNames: `${kit.appDir}/immutable/assets/[name].[hash][extname]`,
|
|
45
|
+
codeSplitting:
|
|
46
|
+
(Array.isArray(user_service_worker_output_config)
|
|
47
|
+
? user_service_worker_output_config[0].codeSplitting
|
|
48
|
+
: user_service_worker_output_config?.codeSplitting) ?? false
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
outDir: `${out}/client`,
|
|
52
|
+
minify: initial_config.build?.minify,
|
|
53
|
+
// avoid overwriting the client build Vite manifest
|
|
54
|
+
manifest: '.vite/service-worker-manifest.json'
|
|
55
|
+
},
|
|
56
|
+
consumer: 'client'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
warn_overridden_config(config, new_config);
|
|
62
|
+
|
|
63
|
+
return new_config;
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
// our serviceWorker environment only exists when building because Vite only
|
|
67
|
+
// supports the default client environment during development (for now)
|
|
68
|
+
applyToEnvironment(environment) {
|
|
69
|
+
return environment.name === 'serviceWorker';
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
generateBundle(_, bundle) {
|
|
73
|
+
const invalid_modules = new Set();
|
|
74
|
+
const modules = new Map([
|
|
75
|
+
[`${runtime_directory}/app/forms/index.js`, '$app/forms'],
|
|
76
|
+
[`${runtime_directory}/app/navigation/index.js`, '$app/navigation'],
|
|
77
|
+
[`${runtime_directory}/app/state/index.js`, '$app/state']
|
|
78
|
+
]);
|
|
79
|
+
|
|
80
|
+
for (const output of Object.values(bundle)) {
|
|
81
|
+
if (output.type !== 'chunk') continue;
|
|
82
|
+
|
|
83
|
+
for (const id of output.moduleIds) {
|
|
84
|
+
const module = modules.get(id);
|
|
85
|
+
if (module) invalid_modules.add(module);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (invalid_modules.size > 0) {
|
|
90
|
+
throw new Error(
|
|
91
|
+
`Cannot import ${Array.from(modules.values())
|
|
92
|
+
.filter((module) => invalid_modules.has(module))
|
|
93
|
+
.join(', ')} into service-worker code.`
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -89,6 +89,20 @@ export async function dev(
|
|
|
89
89
|
|
|
90
90
|
const runner = get_runner(vite, vite_dev_server);
|
|
91
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Log a response to the console, routed through Vite's logger so that it
|
|
94
|
+
* respects the configured `logLevel` and any `customLogger`
|
|
95
|
+
* @param {number} status
|
|
96
|
+
* @param {string} log
|
|
97
|
+
*/
|
|
98
|
+
function log_dev_response(status, log) {
|
|
99
|
+
if (status < 400) {
|
|
100
|
+
vite_dev_server.config.logger.info(log);
|
|
101
|
+
} else {
|
|
102
|
+
vite_dev_server.config.logger.error(log);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
92
106
|
/**
|
|
93
107
|
* @param {string} url
|
|
94
108
|
* @returns {Promise<Record<string, any>>}
|
|
@@ -580,7 +594,7 @@ export async function dev(
|
|
|
580
594
|
await runner.import(`${get_runtime_base(root)}/server/index.js`)
|
|
581
595
|
);
|
|
582
596
|
|
|
583
|
-
const { set_fix_stack_trace,
|
|
597
|
+
const { set_fix_stack_trace, format_response } = await runner.import(
|
|
584
598
|
`${get_runtime_base(root)}/server/internal.js`
|
|
585
599
|
);
|
|
586
600
|
set_fix_stack_trace(fix_stack_trace);
|
|
@@ -647,11 +661,11 @@ export async function dev(
|
|
|
647
661
|
if (rendered.status === 404) {
|
|
648
662
|
// @ts-expect-error
|
|
649
663
|
serve_static_middleware.handle(req, res, () => {
|
|
650
|
-
|
|
664
|
+
log_dev_response(rendered.status, format_response(rendered.status, request));
|
|
651
665
|
setResponse(res, rendered);
|
|
652
666
|
});
|
|
653
667
|
} else {
|
|
654
|
-
|
|
668
|
+
log_dev_response(rendered.status, format_response(rendered.status, request));
|
|
655
669
|
setResponse(res, rendered);
|
|
656
670
|
}
|
|
657
671
|
} catch (e) {
|