@sveltejs/kit 1.22.0 → 1.22.2
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.22.
|
|
3
|
+
"version": "1.22.2",
|
|
4
4
|
"description": "The fastest way to build Svelte apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"dts-buddy": "^0.0.10",
|
|
36
36
|
"marked": "^4.2.3",
|
|
37
37
|
"rollup": "^3.7.0",
|
|
38
|
-
"svelte": "^4.0.
|
|
38
|
+
"svelte": "^4.0.5",
|
|
39
39
|
"svelte-preprocess": "^5.0.4",
|
|
40
40
|
"typescript": "^4.9.4",
|
|
41
|
-
"vite": "^4.
|
|
41
|
+
"vite": "^4.4.2",
|
|
42
42
|
"vitest": "^0.32.2"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -40,7 +40,7 @@ export function write_root(manifest_data, output) {
|
|
|
40
40
|
dedent`
|
|
41
41
|
<!-- This file is generated by @sveltejs/kit — do not edit it! -->
|
|
42
42
|
<script>
|
|
43
|
-
import { setContext, afterUpdate, onMount } from 'svelte';
|
|
43
|
+
import { setContext, afterUpdate, onMount, tick } from 'svelte';
|
|
44
44
|
import { browser } from '$app/environment';
|
|
45
45
|
|
|
46
46
|
// stores
|
|
@@ -67,7 +67,9 @@ export function write_root(manifest_data, output) {
|
|
|
67
67
|
const unsubscribe = stores.page.subscribe(() => {
|
|
68
68
|
if (mounted) {
|
|
69
69
|
navigated = true;
|
|
70
|
-
|
|
70
|
+
tick().then(() => {
|
|
71
|
+
title = document.title || 'untitled page';
|
|
72
|
+
});
|
|
71
73
|
}
|
|
72
74
|
});
|
|
73
75
|
|
|
@@ -541,8 +541,14 @@ function kit({ svelte_config }) {
|
|
|
541
541
|
// see the kit.output.preloadStrategy option for details on why we have multiple options here
|
|
542
542
|
const ext = kit.output.preloadStrategy === 'preload-mjs' ? 'mjs' : 'js';
|
|
543
543
|
|
|
544
|
+
// We could always use a relative asset base path here, but it's better for performance not to.
|
|
545
|
+
// E.g. Vite generates `new URL('/asset.png', import.meta).href` for a relative path vs just '/asset.png'.
|
|
546
|
+
// That's larger and takes longer to run and also causes an HTML diff between SSR and client
|
|
547
|
+
// causing us to do a more expensive hydration check.
|
|
548
|
+
const client_base = kit.paths.relative || kit.paths.assets ? './' : kit.paths.base || '/';
|
|
549
|
+
|
|
544
550
|
new_config = {
|
|
545
|
-
base: ssr ? assets_base(kit) :
|
|
551
|
+
base: ssr ? assets_base(kit) : client_base,
|
|
546
552
|
build: {
|
|
547
553
|
copyPublicDir: !ssr,
|
|
548
554
|
cssCodeSplit: true,
|
|
@@ -36,6 +36,10 @@ export async function preview(vite, vite_config, svelte_config) {
|
|
|
36
36
|
|
|
37
37
|
const dir = join(svelte_config.kit.outDir, 'output/server');
|
|
38
38
|
|
|
39
|
+
if (!fs.existsSync(dir)) {
|
|
40
|
+
throw new Error(`Server files not found at ${dir}, did you run \`build\` first?`);
|
|
41
|
+
}
|
|
42
|
+
|
|
39
43
|
/** @type {import('types').ServerInternalModule} */
|
|
40
44
|
const { set_assets } = await import(pathToFileURL(join(dir, 'internal.js')).href);
|
|
41
45
|
|
package/src/version.js
CHANGED