@sveltejs/kit
Advanced tools
Comparing version 2.6.4 to 2.7.0
{ | ||
"name": "@sveltejs/kit", | ||
"version": "2.6.4", | ||
"version": "2.7.0", | ||
"description": "SvelteKit is the fastest way to build Svelte apps", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -335,4 +335,6 @@ import 'svelte'; // pick up `declare module "*.svelte"` | ||
* }, | ||
* // must be specified with either the `report-uri` or `report-to` directives, or both | ||
* reportOnly: { | ||
* 'script-src': ['self'] | ||
* 'script-src': ['self'], | ||
* 'report-uri': ['/'] | ||
* } | ||
@@ -339,0 +341,0 @@ * } |
@@ -275,3 +275,6 @@ import fs from 'node:fs'; | ||
vite.ssrFixStacktrace(error); | ||
} catch {} | ||
} catch { | ||
// ssrFixStacktrace can fail on StackBlitz web containers and we don't know why | ||
// by ignoring it the line numbers are wrong, but at least we can show the error | ||
} | ||
return error.stack; | ||
@@ -528,3 +531,9 @@ } | ||
}, | ||
read: (file) => fs.readFileSync(path.join(svelte_config.kit.files.assets, file)), | ||
read: (file) => { | ||
if (file in manifest._.server_assets) { | ||
return fs.readFileSync(from_fs(file)); | ||
} | ||
return fs.readFileSync(path.join(svelte_config.kit.files.assets, file)); | ||
}, | ||
before_handle: (event, config, prerender) => { | ||
@@ -531,0 +540,0 @@ async_local_storage.enterWith({ event, config, prerender }); |
@@ -196,3 +196,9 @@ import fs from 'node:fs'; | ||
}, | ||
read: (file) => fs.readFileSync(join(svelte_config.kit.files.assets, file)), | ||
read: (file) => { | ||
if (file in manifest._.server_assets) { | ||
return fs.readFileSync(join(dir, file)); | ||
} | ||
return fs.readFileSync(join(svelte_config.kit.files.assets, file)); | ||
}, | ||
emulator | ||
@@ -199,0 +205,0 @@ }) |
import * as set_cookie_parser from 'set-cookie-parser'; | ||
import { respond } from './respond.js'; | ||
import * as paths from '__sveltekit/paths'; | ||
import { read_implementation } from '__sveltekit/server'; | ||
@@ -84,4 +85,5 @@ /** | ||
const is_asset = manifest.assets.has(filename); | ||
const is_asset_html = manifest.assets.has(filename_html); | ||
const is_asset = manifest.assets.has(filename) || filename in manifest._.server_assets; | ||
const is_asset_html = | ||
manifest.assets.has(filename_html) || filename_html in manifest._.server_assets; | ||
@@ -99,2 +101,12 @@ if (is_asset || is_asset_html) { | ||
}); | ||
} else if (read_implementation) { | ||
const length = manifest._.server_assets[file]; | ||
const type = manifest.mimeTypes[file.slice(file.lastIndexOf('.'))]; | ||
return new Response(read_implementation(file), { | ||
headers: { | ||
'Content-Length': '' + length, | ||
'Content-Type': type | ||
} | ||
}); | ||
} | ||
@@ -101,0 +113,0 @@ |
@@ -268,2 +268,3 @@ import * as devalue from 'devalue'; | ||
branch.map((b) => b.server_data), | ||
csp, | ||
global | ||
@@ -515,5 +516,3 @@ ); | ||
{ | ||
headers: { | ||
'content-type': 'text/html' | ||
} | ||
headers | ||
} | ||
@@ -529,6 +528,7 @@ ); | ||
* @param {Array<import('types').ServerDataNode | null>} nodes | ||
* @param {import('./csp.js').Csp} csp | ||
* @param {string} global | ||
* @returns {{ data: string, chunks: AsyncIterable<string> | null }} | ||
*/ | ||
function get_data(event, options, nodes, global) { | ||
function get_data(event, options, nodes, csp, global) { | ||
let promise_id = 1; | ||
@@ -572,3 +572,5 @@ let count = 0; | ||
push(`<script>${global}.resolve(${str})</script>\n`); | ||
push( | ||
`<script${csp.script_needs_nonce ? ` nonce="${csp.nonce}"` : ''}>${global}.resolve(${str})</script>\n` | ||
); | ||
if (count === 0) done(); | ||
@@ -575,0 +577,0 @@ } |
// generated during release, do not modify | ||
/** @type {string} */ | ||
export const VERSION = '2.6.4'; | ||
export const VERSION = '2.7.0'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
738428
21457