@@ -3,7 +3,6 @@ import path from 'node:path';
33import colors from 'kleur' ;
44import { posixify } from '../../utils/filesystem.js' ;
55import { 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