@sveltejs/kit 2.69.1 → 2.69.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 +1 -1
- package/src/exports/vite/index.js +17 -0
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -482,6 +482,23 @@ async function kit({ svelte_config }) {
|
|
|
482
482
|
];
|
|
483
483
|
}
|
|
484
484
|
|
|
485
|
+
// Vite's `define` is a compile-time text replacement, but Vitest strips
|
|
486
|
+
// user `define` from the server config and reinstalls the values only as
|
|
487
|
+
// `globalThis` properties inside test workers, so anything
|
|
488
|
+
// that runs outside of a test will freak out over
|
|
489
|
+
// them not being defined
|
|
490
|
+
if (process.env.VITEST === 'true') {
|
|
491
|
+
for (const key in new_config.define) {
|
|
492
|
+
const value = new_config.define[key];
|
|
493
|
+
try {
|
|
494
|
+
/** @type {Record<string, any>} */ (globalThis)[key] = JSON.parse(value);
|
|
495
|
+
} catch {
|
|
496
|
+
// `kit_global` isn't JSON, so don't try to parse it. We may one day
|
|
497
|
+
// need to define it in Vitest somehow but for now, ignore it
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
485
502
|
warn_overridden_config(config, new_config);
|
|
486
503
|
|
|
487
504
|
return new_config;
|
package/src/version.js
CHANGED