Skip to content

Commit

Permalink
fix: respect build.target config supplied by user (#11688)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Jan 19, 2024
1 parent df381db commit 36dc54a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-insects-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sveltejs/kit": patch
---

fix: use Vite's default value for `build.target` and respect override supplied by user
2 changes: 0 additions & 2 deletions documentation/docs/60-appendix/30-migrating-to-sveltekit-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,3 @@ SvelteKit 2 requires Node `18.13` or higher, and the following minimum dependenc
`svelte-migrate` will update your `package.json` for you.

As part of the TypeScript upgrade, the generated `tsconfig.json` (the one your `tsconfig.json` extends from) now uses `"moduleResolution": "bundler"` (which is recommended by the TypeScript team, as it properly resolves types from packages with an `exports` map in package.json) and `verbatimModuleSyntax` (which replaces the existing `importsNotUsedAsValues ` and `preserveValueImports` flags — if you have those in your `tsconfig.json`, remove them. `svelte-migrate` will do this for you).

SvelteKit 2 uses ES2022 features, which are supported in all modern browsers.
2 changes: 1 addition & 1 deletion packages/kit/src/exports/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ async function kit({ svelte_config }) {
preserveEntrySignatures: 'strict'
},
ssrEmitAssets: true,
target: ssr ? 'node18.13' : 'es2022'
target: ssr ? 'node18.13' : undefined
},
publicDir: kit.files.assets,
worker: {
Expand Down

0 comments on commit 36dc54a

Please sign in to comment.