Skip to content

Commit d126d72

Browse files
authored
Merge branch 'version-2' into vps-peerDep
2 parents ed8493e + d7d0b02 commit d126d72

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.changeset/gentle-guests-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': major
3+
---
4+
5+
breaking: drop support for Svelte 3

packages/kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"peerDependencies": {
4343
"@sveltejs/vite-plugin-svelte": "^3.0.0",
44-
"svelte": "^3.54.0 || ^4.0.0-next.0 || ^5.0.0-next.0",
44+
"svelte": "^4.0.0 || ^5.0.0-next.0",
4545
"vite": "^5.0.3"
4646
},
4747
"bin": {

packages/kit/src/core/sync/write_tsconfig.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import path from 'node:path';
33
import colors from 'kleur';
44
import { posixify } from '../../utils/filesystem.js';
55
import { write_if_changed } from './utils.js';
6-
import { ts } from './ts.js';
76

87
/**
98
* @param {string} cwd
@@ -129,23 +128,19 @@ export function get_tsconfig(kit, include_base_url) {
129128
// essential options
130129
// svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript
131130
// to enforce using \`import type\` instead of \`import\` for Types.
132-
importsNotUsedAsValues: 'error',
131+
// Also, TypeScript doesn't know about import usages in the template because it only sees the
132+
// script of a Svelte file. Therefore preserve all value imports.
133+
verbatimModuleSyntax: true,
133134
// Vite compiles modules one at a time
134135
isolatedModules: true,
135-
// TypeScript doesn't know about import usages in the template because it only sees the
136-
// script of a Svelte file. Therefore preserve all value imports. Requires TS 4.5 or higher.
137-
preserveValueImports: true,
138136

139137
// This is required for svelte-package to work as expected
140138
// Can be overwritten
141139
lib: ['esnext', 'DOM', 'DOM.Iterable'],
142140
moduleResolution: 'bundler',
143141
module: 'esnext',
144142
noEmit: true, // prevent tsconfig error "overwriting input files" - Vite handles the build and ignores this
145-
target: 'esnext',
146-
147-
// TODO(v2): use the new flag verbatimModuleSyntax instead (requires support by Vite/Esbuild)
148-
ignoreDeprecations: ts && Number(ts.version.split('.')[0]) >= 5 ? '5.0' : undefined
143+
target: 'esnext'
149144
},
150145
include: [...include],
151146
exclude

0 commit comments

Comments
 (0)