@inertiajs/svelte 3.3.0 → 3.4.0

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.
@@ -1,8 +1,8 @@
1
- import { buildSSRBody, getInitialPageFromDOM, http as httpModule, router, setupProgress, } from '@inertiajs/core';
1
+ import { buildSSRBody, exposeInterceptors, getInitialPageFromDOM, http as httpModule, router, setupProgress, } from '@inertiajs/core';
2
2
  import { hydrate, mount } from 'svelte';
3
3
  import App, {} from './components/App.svelte';
4
4
  import { config } from './index';
5
- export default async function createInertiaApp({ id = 'app', resolve, setup, progress = {}, page, defaults = {}, nonce, http, layout, withApp, } = {}) {
5
+ export default async function createInertiaApp({ id = 'app', resolve, setup, progress = {}, page, defaults = {}, nonce, http, layout, withApp, dev = !!import.meta.env?.DEV, } = {}) {
6
6
  config.replace(defaults);
7
7
  if (nonce) {
8
8
  config.set('nonce', nonce);
@@ -10,6 +10,9 @@ export default async function createInertiaApp({ id = 'app', resolve, setup, pro
10
10
  if (http) {
11
11
  httpModule.setClient(http);
12
12
  }
13
+ if (dev) {
14
+ exposeInterceptors();
15
+ }
13
16
  const isServer = typeof window === 'undefined';
14
17
  const resolveComponent = (name, page) => Promise.resolve(resolve(name, page));
15
18
  if (isServer && !page) {
package/dist/env.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ interface ImportMetaEnv {
2
+ readonly DEV: boolean
3
+ }
4
+
5
+ interface ImportMeta {
6
+ readonly env?: ImportMetaEnv
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inertiajs/svelte",
3
- "version": "3.3.0",
3
+ "version": "3.4.0",
4
4
  "license": "MIT",
5
5
  "description": "The Svelte adapter for Inertia.js",
6
6
  "contributors": [
@@ -40,7 +40,7 @@
40
40
  "@sveltejs/kit": "^2.60.1",
41
41
  "@sveltejs/package": "^2.5.7",
42
42
  "@sveltejs/vite-plugin-svelte": "^7.0.0",
43
- "axios": "^1.15.2",
43
+ "axios": "^1.17.0",
44
44
  "es-check": "9.5.3",
45
45
  "publint": "^0.3.17",
46
46
  "svelte": "^5.55.7",
@@ -55,7 +55,7 @@
55
55
  "dependencies": {
56
56
  "es-toolkit": "^1.33.0",
57
57
  "laravel-precognition": "^2.0.0",
58
- "@inertiajs/core": "3.3.0"
58
+ "@inertiajs/core": "3.4.0"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "pnpm package && svelte-check --tsconfig ./tsconfig.json && publint",