Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-env-dts-windows-path.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: use forward slashes in the generated `env.d.ts` import path on Windows
3 changes: 2 additions & 1 deletion packages/kit/src/core/sync/write_env.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/** @import { EnvVarConfig } from '@sveltejs/kit' */
import path from 'node:path';
import { create_explicit_env_types } from '../env.js';
import { posixify } from '../../utils/filesystem.js';
import { write_if_changed } from './utils.js';

const DOCS = '// See https://svelte.dev/docs/kit/environment-variables for more information';
Expand All @@ -18,7 +19,7 @@ export function write_env(kit, entry, env_config) {
const out = path.join(kit.outDir, 'env.d.ts');

if (entry && env_config) {
const relative = path.relative(kit.outDir, entry);
const relative = posixify(path.relative(kit.outDir, entry));
content.push(
`// This file is generated from ${relative}.\n${DOCS}`,
create_explicit_env_types(env_config, relative, 'private'),
Expand Down
Loading