@sveltejs/kit 1.5.3 → 1.5.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.5.3",
3
+ "version": "1.5.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -632,7 +632,15 @@ export function set_assets(path) {
632
632
  // CLI args
633
633
  mode: vite_config_env.mode,
634
634
  logLevel: vite_config.logLevel,
635
- clearScreen: vite_config.clearScreen
635
+ clearScreen: vite_config.clearScreen,
636
+ build: {
637
+ minify: vite_config.build.minify,
638
+ assetsInlineLimit: vite_config.build.assetsInlineLimit,
639
+ sourcemap: vite_config.build.sourcemap
640
+ },
641
+ optimizeDeps: {
642
+ force: vite_config.optimizeDeps.force
643
+ }
636
644
  })
637
645
  );
638
646
 
@@ -1256,7 +1256,22 @@ export function create_client({ target }) {
1256
1256
  if (!options.reload) {
1257
1257
  if (priority <= options.preload_data) {
1258
1258
  const intent = get_navigation_intent(/** @type {URL} */ (url), false);
1259
- if (intent) preload_data(intent);
1259
+ if (intent) {
1260
+ if (__SVELTEKIT_DEV__) {
1261
+ preload_data(intent).then((result) => {
1262
+ if (result.type === 'loaded' && result.state.error) {
1263
+ console.warn(
1264
+ `Preloading data for ${intent.url.pathname} failed with the following error: ${result.state.error.message}\n` +
1265
+ 'If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. ' +
1266
+ 'This route was preloaded due to a data-sveltekit-preload-data attribute. ' +
1267
+ 'See https://kit.svelte.dev/docs/link-options for more info'
1268
+ );
1269
+ }
1270
+ });
1271
+ } else {
1272
+ preload_data(intent);
1273
+ }
1274
+ }
1260
1275
  } else if (priority <= options.preload_code) {
1261
1276
  preload_code(get_url_path(/** @type {URL} */ (url)));
1262
1277
  }
package/types/index.d.ts CHANGED
@@ -304,6 +304,8 @@ export interface KitConfig {
304
304
  * > When `mode` is `'auto'`, SvelteKit will use nonces for dynamically rendered pages and hashes for prerendered pages. Using nonces with prerendered pages is insecure and therefore forbidden.
305
305
  *
306
306
  * > Note that most [Svelte transitions](https://svelte.dev/tutorial/transition) work by creating an inline `<style>` element. If you use these in your app, you must either leave the `style-src` directive unspecified or add `unsafe-inline`.
307
+ *
308
+ * If this level of configuration is insufficient and you have more dynamic requirements, you can use the [`handle` hook](https://kit.svelte.dev/docs/hooks#server-hooks-handle) to roll your own CSP.
307
309
  */
308
310
  csp?: {
309
311
  /**