@sveltejs/kit 2.7.2 → 2.7.3
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/README.md +4 -4
- package/package.json +2 -2
- package/src/core/config/index.js +1 -1
- package/src/core/config/options.js +8 -8
- package/src/core/postbuild/prerender.js +6 -6
- package/src/core/sync/write_ambient.js +1 -1
- package/src/core/sync/write_tsconfig.js +1 -1
- package/src/exports/public.d.ts +54 -55
- package/src/exports/vite/dev/index.js +1 -1
- package/src/exports/vite/index.js +19 -3
- package/src/exports/vite/preview/index.js +7 -0
- package/src/runtime/app/paths/types.d.ts +2 -2
- package/src/runtime/app/stores.js +2 -2
- package/src/runtime/client/client.js +5 -5
- package/src/runtime/client/fetcher.js +1 -1
- package/src/runtime/server/fetch.js +1 -1
- package/src/runtime/server/page/actions.js +9 -1
- package/src/runtime/server/page/index.js +2 -2
- package/src/runtime/server/page/load_data.js +1 -1
- package/src/runtime/server/page/render.js +3 -4
- package/src/types/ambient.d.ts +7 -7
- package/src/types/synthetic/$env+dynamic+private.md +1 -1
- package/src/types/synthetic/$env+dynamic+public.md +1 -1
- package/src/types/synthetic/$env+static+private.md +2 -2
- package/src/types/synthetic/$env+static+public.md +1 -1
- package/src/types/synthetic/$lib.md +2 -2
- package/src/version.js +1 -1
- package/types/index.d.ts +67 -68
- package/types/index.d.ts.map +1 -1
|
@@ -93,7 +93,7 @@ const warning_preprocessor = {
|
|
|
93
93
|
|
|
94
94
|
const message =
|
|
95
95
|
`\n${colors.bold().red(path.relative('.', filename))}\n` +
|
|
96
|
-
`\`${match[1]}\` will be ignored — move it to ${fixed} instead. See https://
|
|
96
|
+
`\`${match[1]}\` will be ignored — move it to ${fixed} instead. See https://svelte.dev/docs/kit/page-options for more information.`;
|
|
97
97
|
|
|
98
98
|
if (!warned.has(message)) {
|
|
99
99
|
console.log(message);
|
|
@@ -352,6 +352,9 @@ async function kit({ svelte_config }) {
|
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
354
|
|
|
355
|
+
/** @type {Map<string, string>} */
|
|
356
|
+
const import_map = new Map();
|
|
357
|
+
|
|
355
358
|
/** @type {import('vite').Plugin} */
|
|
356
359
|
const plugin_virtual_modules = {
|
|
357
360
|
name: 'vite-plugin-sveltekit-virtual-modules',
|
|
@@ -372,6 +375,8 @@ async function kit({ svelte_config }) {
|
|
|
372
375
|
`Cannot import ${id} into service-worker code. Only the modules $service-worker and $env/static/public are available in service workers.`
|
|
373
376
|
);
|
|
374
377
|
}
|
|
378
|
+
|
|
379
|
+
import_map.set(id, importer);
|
|
375
380
|
}
|
|
376
381
|
|
|
377
382
|
// treat $env/static/[public|private] as virtual
|
|
@@ -398,7 +403,18 @@ async function kit({ svelte_config }) {
|
|
|
398
403
|
})
|
|
399
404
|
) {
|
|
400
405
|
const relative = normalize_id(id, normalized_lib, normalized_cwd);
|
|
401
|
-
|
|
406
|
+
|
|
407
|
+
const illegal_module = strip_virtual_prefix(relative);
|
|
408
|
+
|
|
409
|
+
if (import_map.has(illegal_module)) {
|
|
410
|
+
const importer = path.relative(
|
|
411
|
+
cwd,
|
|
412
|
+
/** @type {string} */ (import_map.get(illegal_module))
|
|
413
|
+
);
|
|
414
|
+
throw new Error(`Cannot import ${illegal_module} into client-side code: ${importer}`);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
throw new Error(`Cannot import ${illegal_module} into client-side code`);
|
|
402
418
|
}
|
|
403
419
|
}
|
|
404
420
|
|
|
@@ -900,7 +916,7 @@ async function kit({ svelte_config }) {
|
|
|
900
916
|
} else {
|
|
901
917
|
console.log(colors.bold().yellow('\nNo adapter specified'));
|
|
902
918
|
|
|
903
|
-
const link = colors.bold().cyan('https://
|
|
919
|
+
const link = colors.bold().cyan('https://svelte.dev/docs/kit/adapters');
|
|
904
920
|
console.log(
|
|
905
921
|
`See ${link} to learn how to configure your app to run on the platform of your choosing`
|
|
906
922
|
);
|
|
@@ -131,6 +131,13 @@ export async function preview(vite, vite_config, svelte_config) {
|
|
|
131
131
|
let filename = normalizePath(
|
|
132
132
|
join(svelte_config.kit.outDir, 'output/prerendered/pages' + pathname)
|
|
133
133
|
);
|
|
134
|
+
|
|
135
|
+
try {
|
|
136
|
+
filename = decodeURI(filename);
|
|
137
|
+
} catch {
|
|
138
|
+
// malformed URI
|
|
139
|
+
}
|
|
140
|
+
|
|
134
141
|
let prerendered = is_file(filename);
|
|
135
142
|
|
|
136
143
|
if (!prerendered) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* A string that matches [`config.kit.paths.base`](https://
|
|
2
|
+
* A string that matches [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths).
|
|
3
3
|
*
|
|
4
4
|
* Example usage: `<a href="{base}/your-page">Link</a>`
|
|
5
5
|
*/
|
|
6
6
|
export let base: '' | `/${string}`;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* An absolute path that matches [`config.kit.paths.assets`](https://
|
|
9
|
+
* An absolute path that matches [`config.kit.paths.assets`](https://svelte.dev/docs/kit/configuration#paths).
|
|
10
10
|
*
|
|
11
11
|
* > [!NOTE] If a value for `config.kit.paths.assets` is specified, it will be replaced with `'/_svelte_kit_assets'` during `vite dev` or `vite preview`, since the assets don't yet live at their eventual URL.
|
|
12
12
|
*/
|
|
@@ -53,7 +53,7 @@ export const navigating = {
|
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
* A readable store whose initial value is `false`. If [`version.pollInterval`](https://
|
|
56
|
+
* A readable store whose initial value is `false`. If [`version.pollInterval`](https://svelte.dev/docs/kit/configuration#version) is a non-zero value, SvelteKit will poll for new versions of the app and update the store value to `true` when it detects one. `updated.check()` will force an immediate check, regardless of polling.
|
|
57
57
|
*
|
|
58
58
|
* On the server, this store can only be subscribed to during component initialization. In the browser, it can be subscribed to at any time.
|
|
59
59
|
* @type {import('svelte/store').Readable<boolean> & { check(): Promise<boolean> }}
|
|
@@ -88,7 +88,7 @@ function get_store(name) {
|
|
|
88
88
|
} catch {
|
|
89
89
|
throw new Error(
|
|
90
90
|
`Cannot subscribe to '${name}' store on the server outside of a Svelte component, as it is bound to the current request via component context. This prevents state from leaking between users.` +
|
|
91
|
-
'For more information, see https://
|
|
91
|
+
'For more information, see https://svelte.dev/docs/kit/state-management#avoid-shared-state-on-the-server'
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -1574,7 +1574,7 @@ function setup_preload() {
|
|
|
1574
1574
|
`Preloading data for ${intent.url.pathname} failed with the following error: ${result.state.error.message}\n` +
|
|
1575
1575
|
'If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. ' +
|
|
1576
1576
|
'This route was preloaded due to a data-sveltekit-preload-data attribute. ' +
|
|
1577
|
-
'See https://
|
|
1577
|
+
'See https://svelte.dev/docs/kit/link-options for more info'
|
|
1578
1578
|
);
|
|
1579
1579
|
}
|
|
1580
1580
|
});
|
|
@@ -1717,12 +1717,12 @@ export function disableScrollHandling() {
|
|
|
1717
1717
|
* Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`.
|
|
1718
1718
|
* For external URLs, use `window.location = url` instead of calling `goto(url)`.
|
|
1719
1719
|
*
|
|
1720
|
-
* @param {string | URL} url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://
|
|
1720
|
+
* @param {string | URL} url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://svelte.dev/docs/kit/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.
|
|
1721
1721
|
* @param {Object} [opts] Options related to the navigation
|
|
1722
1722
|
* @param {boolean} [opts.replaceState] If `true`, will replace the current `history` entry rather than creating a new one with `pushState`
|
|
1723
1723
|
* @param {boolean} [opts.noScroll] If `true`, the browser will maintain its scroll position rather than scrolling to the top of the page after navigation
|
|
1724
1724
|
* @param {boolean} [opts.keepFocus] If `true`, the currently focused element will retain focus after navigation. Otherwise, focus will be reset to the body
|
|
1725
|
-
* @param {boolean} [opts.invalidateAll] If `true`, all `load` functions of the page will be rerun. See https://
|
|
1725
|
+
* @param {boolean} [opts.invalidateAll] If `true`, all `load` functions of the page will be rerun. See https://svelte.dev/docs/kit/load#rerunning-load-functions for more info on invalidation.
|
|
1726
1726
|
* @param {App.PageState} [opts.state] An optional object that will be available on the `$page.state` store
|
|
1727
1727
|
* @returns {Promise<void>}
|
|
1728
1728
|
*/
|
|
@@ -1861,7 +1861,7 @@ export function preloadCode(pathname) {
|
|
|
1861
1861
|
}
|
|
1862
1862
|
|
|
1863
1863
|
/**
|
|
1864
|
-
* Programmatically create a new history entry with the given `$page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://
|
|
1864
|
+
* Programmatically create a new history entry with the given `$page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing).
|
|
1865
1865
|
*
|
|
1866
1866
|
* @param {string | URL} url
|
|
1867
1867
|
* @param {App.PageState} state
|
|
@@ -1905,7 +1905,7 @@ export function pushState(url, state) {
|
|
|
1905
1905
|
}
|
|
1906
1906
|
|
|
1907
1907
|
/**
|
|
1908
|
-
* Programmatically replace the current history entry with the given `$page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://
|
|
1908
|
+
* Programmatically replace the current history entry with the given `$page.state`. To use the current URL, you can pass `''` as the first argument. Used for [shallow routing](https://svelte.dev/docs/kit/shallow-routing).
|
|
1909
1909
|
*
|
|
1910
1910
|
* @param {string | URL} url
|
|
1911
1911
|
* @param {App.PageState} state
|
|
@@ -53,7 +53,7 @@ if (DEV && BROWSER) {
|
|
|
53
53
|
|
|
54
54
|
if (in_load_heuristic && !used_kit_fetch) {
|
|
55
55
|
console.warn(
|
|
56
|
-
`Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://
|
|
56
|
+
`Loading ${url} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://svelte.dev/docs/kit/load#making-fetch-requests`
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -97,7 +97,7 @@ export function create_fetch({ event, options, manifest, state, get_cookie_heade
|
|
|
97
97
|
return new Response(state.read(file), {
|
|
98
98
|
headers: type ? { 'content-type': type } : {}
|
|
99
99
|
});
|
|
100
|
-
} else if (read_implementation) {
|
|
100
|
+
} else if (read_implementation && file in manifest._.server_assets) {
|
|
101
101
|
const length = manifest._.server_assets[file];
|
|
102
102
|
const type = manifest.mimeTypes[file.slice(file.lastIndexOf('.'))];
|
|
103
103
|
|
|
@@ -197,7 +197,7 @@ export async function handle_action_request(event, server) {
|
|
|
197
197
|
function check_named_default_separate(actions) {
|
|
198
198
|
if (actions.default && Object.keys(actions).length > 1) {
|
|
199
199
|
throw new Error(
|
|
200
|
-
'When using named actions, the default action cannot be used. See the docs for more info: https://
|
|
200
|
+
'When using named actions, the default action cannot be used. See the docs for more info: https://svelte.dev/docs/kit/form-actions#named-actions'
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
@@ -280,6 +280,14 @@ function try_deserialize(data, fn, route_id) {
|
|
|
280
280
|
// If we're here, the data could not be serialized with devalue
|
|
281
281
|
const error = /** @type {any} */ (e);
|
|
282
282
|
|
|
283
|
+
// if someone tries to use `json()` in their action
|
|
284
|
+
if (data instanceof Response) {
|
|
285
|
+
throw new Error(
|
|
286
|
+
`Data returned from action inside ${route_id} is not serializable. Form actions need to return plain objects or fail(). E.g. return { success: true } or return fail(400, { message: "invalid" });`
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// if devalue could not serialize a property on the object, etc.
|
|
283
291
|
if ('path' in error) {
|
|
284
292
|
let message = `Data returned from action inside ${route_id} is not serializable: ${error.message}`;
|
|
285
293
|
if (error.path !== '') message += ` (data.${error.path})`;
|
|
@@ -105,12 +105,12 @@ export async function render_page(event, page, options, manifest, state, resolve
|
|
|
105
105
|
if (DEV && action_result && !event.request.headers.has('x-sveltekit-action')) {
|
|
106
106
|
if (action_result.type === 'error') {
|
|
107
107
|
console.warn(
|
|
108
|
-
"The form action returned an error, but +error.svelte wasn't rendered because SSR is off. To get the error page with CSR, enhance your form with `use:enhance`. See https://
|
|
108
|
+
"The form action returned an error, but +error.svelte wasn't rendered because SSR is off. To get the error page with CSR, enhance your form with `use:enhance`. See https://svelte.dev/docs/kit/form-actions#progressive-enhancement-use-enhance"
|
|
109
109
|
);
|
|
110
110
|
} else if (action_result.data) {
|
|
111
111
|
/// case: lost data
|
|
112
112
|
console.warn(
|
|
113
|
-
"The form action returned a value, but it isn't available in `$page.form`, because SSR is off. To handle the returned value in CSR, enhance your form with `use:enhance`. See https://
|
|
113
|
+
"The form action returned a value, but it isn't available in `$page.form`, because SSR is off. To handle the returned value in CSR, enhance your form with `use:enhance`. See https://svelte.dev/docs/kit/form-actions#progressive-enhancement-use-enhance"
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -348,7 +348,7 @@ export function create_universal_fetch(event, state, fetched, csr, resolve_opts)
|
|
|
348
348
|
const included = resolve_opts.filterSerializedResponseHeaders(lower, value);
|
|
349
349
|
if (!included) {
|
|
350
350
|
throw new Error(
|
|
351
|
-
`Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://
|
|
351
|
+
`Failed to get response header "${lower}" — it must be included by the \`filterSerializedResponseHeaders\` option: https://svelte.dev/docs/kit/hooks#Server-hooks-handle (at ${event.route.id})`
|
|
352
352
|
);
|
|
353
353
|
}
|
|
354
354
|
}
|
|
@@ -480,7 +480,7 @@ export async function render_response({
|
|
|
480
480
|
if (page_config.csr) {
|
|
481
481
|
if (transformed.split('<!--').length < html.split('<!--').length) {
|
|
482
482
|
// the \u001B stuff is ANSI codes, so that we don't need to add a library to the runtime
|
|
483
|
-
// https://svelte.dev/
|
|
483
|
+
// https://svelte.dev/playground/1b3f49696f0c44c881c34587f2537aa2?version=4.2.19
|
|
484
484
|
console.warn(
|
|
485
485
|
"\u001B[1m\u001B[31mRemoving comments in transformPageChunk can break Svelte's hydration\u001B[39m\u001B[22m"
|
|
486
486
|
);
|
|
@@ -566,9 +566,8 @@ function get_data(event, options, nodes, csp, global) {
|
|
|
566
566
|
str = devalue.uneval({ id, data, error }, replacer);
|
|
567
567
|
}
|
|
568
568
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
);
|
|
569
|
+
const nonce = csp.script_needs_nonce ? ` nonce="${csp.nonce}"` : '';
|
|
570
|
+
push(`<script${nonce}>${global}.resolve(${str})</script>\n`);
|
|
572
571
|
if (count === 0) done();
|
|
573
572
|
}
|
|
574
573
|
);
|
package/src/types/ambient.d.ts
CHANGED
|
@@ -29,30 +29,30 @@ declare namespace App {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* The interface that defines `event.locals`, which can be accessed in [hooks](https://
|
|
32
|
+
* The interface that defines `event.locals`, which can be accessed in [hooks](https://svelte.dev/docs/kit/hooks) (`handle`, and `handleError`), server-only `load` functions, and `+server.js` files.
|
|
33
33
|
*/
|
|
34
34
|
export interface Locals {}
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Defines the common shape of the [$page.data store](https://
|
|
37
|
+
* Defines the common shape of the [$page.data store](https://svelte.dev/docs/kit/$app-stores#page) - that is, the data that is shared between all pages.
|
|
38
38
|
* The `Load` and `ServerLoad` functions in `./$types` will be narrowed accordingly.
|
|
39
39
|
* Use optional properties for data that is only present on specific pages. Do not add an index signature (`[key: string]: any`).
|
|
40
40
|
*/
|
|
41
41
|
export interface PageData {}
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* The shape of the `$page.state` object, which can be manipulated using the [`pushState`](https://
|
|
44
|
+
* The shape of the `$page.state` object, which can be manipulated using the [`pushState`](https://svelte.dev/docs/kit/$app-navigation#pushState) and [`replaceState`](https://svelte.dev/docs/kit/$app-navigation#replaceState) functions from `$app/navigation`.
|
|
45
45
|
*/
|
|
46
46
|
export interface PageState {}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* If your adapter provides [platform-specific context](https://
|
|
49
|
+
* If your adapter provides [platform-specific context](https://svelte.dev/docs/kit/adapters#platform-specific-context) via `event.platform`, you can specify it here.
|
|
50
50
|
*/
|
|
51
51
|
export interface Platform {}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* This module is only available to [service workers](https://
|
|
55
|
+
* This module is only available to [service workers](https://svelte.dev/docs/kit/service-workers).
|
|
56
56
|
*/
|
|
57
57
|
declare module '$service-worker' {
|
|
58
58
|
/**
|
|
@@ -66,7 +66,7 @@ declare module '$service-worker' {
|
|
|
66
66
|
*/
|
|
67
67
|
export const build: string[];
|
|
68
68
|
/**
|
|
69
|
-
* An array of URL strings representing the files in your static directory, or whatever directory is specified by `config.kit.files.assets`. You can customize which files are included from `static` directory using [`config.kit.serviceWorker.files`](https://
|
|
69
|
+
* An array of URL strings representing the files in your static directory, or whatever directory is specified by `config.kit.files.assets`. You can customize which files are included from `static` directory using [`config.kit.serviceWorker.files`](https://svelte.dev/docs/kit/configuration)
|
|
70
70
|
*/
|
|
71
71
|
export const files: string[];
|
|
72
72
|
/**
|
|
@@ -75,7 +75,7 @@ declare module '$service-worker' {
|
|
|
75
75
|
*/
|
|
76
76
|
export const prerendered: string[];
|
|
77
77
|
/**
|
|
78
|
-
* See [`config.kit.version`](https://
|
|
78
|
+
* See [`config.kit.version`](https://svelte.dev/docs/kit/configuration#version). It's useful for generating unique cache names inside your service worker, so that a later deployment of your app can invalidate old caches.
|
|
79
79
|
*/
|
|
80
80
|
export const version: string;
|
|
81
81
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
This module provides access to runtime environment variables, as defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://
|
|
1
|
+
This module provides access to runtime environment variables, as defined by the platform you're running on. For example if you're using [`adapter-node`](https://github.com/sveltejs/kit/tree/main/packages/adapter-node) (or running [`vite preview`](https://svelte.dev/docs/kit/cli)), this is equivalent to `process.env`. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured).
|
|
2
2
|
|
|
3
3
|
This module cannot be imported into client-side code.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Similar to [`$env/dynamic/private`](https://
|
|
1
|
+
Similar to [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), but only includes variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code.
|
|
2
2
|
|
|
3
3
|
Note that public dynamic environment variables must all be sent from the server to the client, causing larger network requests — when possible, use `$env/static/public` instead.
|
|
4
4
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://
|
|
1
|
+
Environment variables [loaded by Vite](https://vitejs.dev/guide/env-and-mode.html#env-files) from `.env` files and `process.env`. Like [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), this module cannot be imported into client-side code. This module only includes variables that _do not_ begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) _and do_ start with [`config.kit.env.privatePrefix`](https://svelte.dev/docs/kit/configuration#env) (if configured).
|
|
2
2
|
|
|
3
|
-
_Unlike_ [`$env/dynamic/private`](https://
|
|
3
|
+
_Unlike_ [`$env/dynamic/private`](https://svelte.dev/docs/kit/$env-dynamic-private), the values exported from this module are statically injected into your bundle at build time, enabling optimisations like dead code elimination.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { API_KEY } from '$env/static/private';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Similar to [`$env/static/private`](https://
|
|
1
|
+
Similar to [`$env/static/private`](https://svelte.dev/docs/kit/$env-static-private), except that it only includes environment variables that begin with [`config.kit.env.publicPrefix`](https://svelte.dev/docs/kit/configuration#env) (which defaults to `PUBLIC_`), and can therefore safely be exposed to client-side code.
|
|
2
2
|
|
|
3
3
|
Values are replaced statically at build time.
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
This is a simple alias to `src/lib`, or whatever directory is specified as [`config.kit.files.lib`](https://
|
|
1
|
+
This is a simple alias to `src/lib`, or whatever directory is specified as [`config.kit.files.lib`](https://svelte.dev/docs/kit/configuration#files). It allows you to access common components and utility modules without `../../../../` nonsense.
|
|
2
2
|
|
|
3
3
|
### `$lib/server`
|
|
4
4
|
|
|
5
|
-
A subdirectory of `$lib`. SvelteKit will prevent you from importing any modules in `$lib/server` into client-side code. See [server-only modules](https://
|
|
5
|
+
A subdirectory of `$lib`. SvelteKit will prevent you from importing any modules in `$lib/server` into client-side code. See [server-only modules](https://svelte.dev/docs/kit/server-only-modules).
|
package/src/version.js
CHANGED