@sveltejs/kit 1.0.0-next.383 → 1.0.0-next.384
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/assets/app/env.js +2 -17
- package/dist/cli.js +1 -1
- package/dist/vite.js +7 -5
- package/package.json +1 -1
- package/types/ambient.d.ts +2 -19
- package/types/internal.d.ts +1 -0
package/assets/app/env.js
CHANGED
|
@@ -5,24 +5,9 @@ export { prerendering } from '../env.js';
|
|
|
5
5
|
*/
|
|
6
6
|
const browser = !import.meta.env.SSR;
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* @type {import('$app/env').server}
|
|
10
|
-
*/
|
|
11
|
-
const server = !!import.meta.env.SSR;
|
|
12
|
-
|
|
13
8
|
/**
|
|
14
9
|
* @type {import('$app/env').dev}
|
|
15
10
|
*/
|
|
16
|
-
const dev =
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @type {import('$app/env').prod}
|
|
20
|
-
*/
|
|
21
|
-
const prod = !import.meta.env.DEV;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @type {import('$app/env').mode}
|
|
25
|
-
*/
|
|
26
|
-
const mode = import.meta.env.MODE;
|
|
11
|
+
const dev = __SVELTEKIT_DEV__;
|
|
27
12
|
|
|
28
|
-
export { browser, dev
|
|
13
|
+
export { browser, dev };
|
package/dist/cli.js
CHANGED
package/dist/vite.js
CHANGED
|
@@ -46,7 +46,7 @@ async function get_vite_config(config_env) {
|
|
|
46
46
|
if (!config) {
|
|
47
47
|
throw new Error('Could not load Vite config');
|
|
48
48
|
}
|
|
49
|
-
return config;
|
|
49
|
+
return { ...config, mode: config_env.mode };
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
@@ -281,7 +281,8 @@ const get_default_config = function ({ config, input, ssr, outDir }) {
|
|
|
281
281
|
__SVELTEKIT_ADAPTER_NAME__: JSON.stringify(config.kit.adapter?.name),
|
|
282
282
|
__SVELTEKIT_APP_VERSION__: JSON.stringify(config.kit.version.name),
|
|
283
283
|
__SVELTEKIT_APP_VERSION_FILE__: JSON.stringify(`${config.kit.appDir}/version.json`),
|
|
284
|
-
__SVELTEKIT_APP_VERSION_POLL_INTERVAL__: JSON.stringify(config.kit.version.pollInterval)
|
|
284
|
+
__SVELTEKIT_APP_VERSION_POLL_INTERVAL__: JSON.stringify(config.kit.version.pollInterval),
|
|
285
|
+
__SVELTEKIT_DEV__: 'false'
|
|
285
286
|
},
|
|
286
287
|
// prevent Vite copying the contents of `config.kit.files.assets`,
|
|
287
288
|
// if it happens to be 'public' instead of 'static'
|
|
@@ -434,9 +435,9 @@ export class Server {
|
|
|
434
435
|
/**
|
|
435
436
|
* @param {{
|
|
436
437
|
* cwd: string;
|
|
437
|
-
* config: import('types').ValidatedConfig
|
|
438
|
-
* vite_config_env: import('vite').ConfigEnv
|
|
439
|
-
* manifest_data: import('types').ManifestData
|
|
438
|
+
* config: import('types').ValidatedConfig;
|
|
439
|
+
* vite_config_env: import('vite').ConfigEnv;
|
|
440
|
+
* manifest_data: import('types').ManifestData;
|
|
440
441
|
* build_dir: string;
|
|
441
442
|
* output_dir: string;
|
|
442
443
|
* service_worker_entry_file: string | null;
|
|
@@ -2976,6 +2977,7 @@ function kit() {
|
|
|
2976
2977
|
}
|
|
2977
2978
|
},
|
|
2978
2979
|
define: {
|
|
2980
|
+
__SVELTEKIT_DEV__: 'true',
|
|
2979
2981
|
__SVELTEKIT_APP_VERSION_POLL_INTERVAL__: '0'
|
|
2980
2982
|
},
|
|
2981
2983
|
resolve: {
|
package/package.json
CHANGED
package/types/ambient.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ declare namespace App {
|
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* ```ts
|
|
68
|
-
* import { browser, dev,
|
|
68
|
+
* import { browser, dev, prerendering } from '$app/env';
|
|
69
69
|
* ```
|
|
70
70
|
*/
|
|
71
71
|
declare module '$app/env' {
|
|
@@ -75,31 +75,14 @@ declare module '$app/env' {
|
|
|
75
75
|
export const browser: boolean;
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Whether the dev server is running. This is not guaranteed to correspond to `NODE_ENV` or `MODE`.
|
|
79
79
|
*/
|
|
80
80
|
export const dev: boolean;
|
|
81
81
|
|
|
82
|
-
/**
|
|
83
|
-
* The Vite.js mode the app is running in. Configure in [`vite.config.js`](https://vitejs.dev/config/shared-options.html#mode).
|
|
84
|
-
* Vite.js loads the dotenv file associated with the provided mode, `.env.[mode]` or `.env.[mode].local`.
|
|
85
|
-
* By default, `vite dev` runs with `mode=development` and `vite build` runs with `mode=production`.
|
|
86
|
-
*/
|
|
87
|
-
export const mode: string;
|
|
88
|
-
|
|
89
82
|
/**
|
|
90
83
|
* `true` when prerendering, `false` otherwise.
|
|
91
84
|
*/
|
|
92
85
|
export const prerendering: boolean;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* `true` in production mode, `false` in development.
|
|
96
|
-
*/
|
|
97
|
-
export const prod: boolean;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* `true` if the app is running on the server.
|
|
101
|
-
*/
|
|
102
|
-
export const server: boolean;
|
|
103
86
|
}
|
|
104
87
|
|
|
105
88
|
/**
|